so i have an assignment to write a function to tell a user "true" is a number is prime and "false" if it isn't.
heres what I have so far:
1 #include<iostream>
2 using namespace std;
3 int main()
4 { bool isPrime(int);
5 int number;
6 cout << "enter a number greater than two" << endl;
7 cin >> number;
8 if (isPrime(number));
9 { cout<< number<< "true" << endl;
10 else
11 cout << number<< "false" << endl;
12 return 0; }
13 {
14 bool isPrime(int number)
15
16 int i;
17 for (i=2; i<number; i++)
18 { if(number% i==0)
19 { return false; }
20 }
21 return true;
22 }
Im getting some compiler errors and I need some help defining my scope and stuff so if anyone could help i would appreciate it!!