hi, this is my prime number check program, i've posted it here b4, thanks to ur helpfull replys i managed to get it up and running how ever it gives this warning....C4715: 'isPrime' : not all control paths return a value....i cant figureout where the error is. could someone tell me how to fix that up. thanks.
#include <iostream>
#include <math.h>
using namespace std;
#define TRUE 1;
#define FALSE 0;
int number;
void getNumber(int &number);
int isPrime(int number);
int main()
{
int number;
getNumber(number);
if (isPrime(number))
{
cout << "\n" << number << "is a prime number\n";
}
if (isPrime(number)==false)
{
cout << "\n" << number << "is not a prime number\n";
}
return 0;
}
void getNumber(int &number)
{
cout << "Please enter a positive number ";
cin >> number;
if (!cin.good())
{
printf("Invalid number entered\n");
exit(1);
}
}
int isPrime(int number)
{
int count=0,count1;
for(count1=2;count1<number;count1++)
{
if (number%count1==0)
{
return FALSE;
}
{
if (count == 0)
return TRUE;
}
}
}