MCPcopy Create free account
hub / github.com/Rustam-Z/cpp-programming / main4

Function main4

Lab_03/Prime.cpp:7–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <iostream>
6using namespace std;
7int main4() {
8 int num, j = 0;
9 cout << "Enter the number: ";
10 cin >> num;
11 for (int i = 1; i <= num; i++)
12 {
13 if ((num % i) == 0)
14 {
15 j++;
16 }
17 }
18 if (j == 2)
19 cout << num << " is a prime number." << endl;
20 else
21 cout << num << " is not a prime number." << endl;
22 system("pause");
23 return 0;
24}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected