Nov 3, 2010 at 12:27am UTC
Well so far I managed to show an output but only from the 'main' functions. I have placed the function call for the bool function but it doesnt show when i run my program. it sure doesn't have any errors and it compiles just fine.
#include <iostream>
using namespace std;
bool isPrime(int val);
int main() {
cout << endl << endl;
cout << " Prime Numbers: " << endl;
cout << "----------------------" << endl;
isPrime();
return 0;
}
bool isPrime(int val) {
for(int val = 0; val >= 0; val++) {
if(val % 2 == 0) {
cout << val << " is a prime number. " << endl;
return true;
}
else {
return false;
}
}
}
I know there is something small that i don't see
Nov 3, 2010 at 2:17am UTC
I see that i need a value but I dont know exactly what to put as the arguement for the call functions
Nov 3, 2010 at 7:01am UTC
R u trying to find prime no. or what ?
Nov 3, 2010 at 12:20pm UTC
It needs to display all prime numbers down between 1 to 100