Home » questions » I Need A HELP FOR C++ ASSIGNMENT ~ASAP?
I Need A HELP FOR C++ ASSIGNMENT ~ASAP?
i have problem with my assignment!!
the question is " write a c++ program that, given an even integer greater than two, (but no greater than one thounsand), produce as output every pair of prime number that sum to it."
eg: input a number is 12
output is 5 7
eg: 38
output: 7 31
19 19
my c++ code is:
//countfactors.cpp
//This program will determine the number of factors of a given number
//And wiil produce every pair of prime number that sum to the given number
#include
#include
using namespace std;
int main()
{
int cout=0; //the number of factors
//get input
cout << " Please enter a positive even interger: ";
cin >> number;
for(int i=2; i<=1000; i++)
{
if (number%1==0)
{
cout ++;
}//end if
}//end loop
cout << "There are " << cout << " factors" << endl;
if(cout==2)
{
cout << "The number is prime" << endl;
}//end if
system("PAUSE");
return 0;
}//end main
can u check my code??
i need to give it to teacher on
tuesday 1 August 2007 , so can u reply to me today.. thanks
I Need someone to correct my C++. I just doing the basic C++ the beginner course~
Orkut Community?? what is the web address??
i am using DEV-C++ to write the code

Answers
Shamiul_islam
On 2006-07-30 10:15:50
Scott c
On 2006-07-30 04:37:03
3dillusion
On 2006-07-30 07:32:42
Eby M
On 2006-07-30 04:39:06