c++ quetion

May 20, 2013 at 5:12pm
Write your question here.

C++ i need this answer asap

Fix all syntax error in this program. Submit the correct program and clearly state which lines had problem and what the problems were.
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;

string generateBall (); //function to generate random number

main ()

{
strin color;
char end;
srand(time(0));

while(cin){
color = generateBall;
cout << "You got a " << color << " Ball"<< endl;
cin >> end;
}

system ("PAUSE");
return 0;

}

string generateBall()
{
string color;
randnum = (rand()%9);
if (randnum <=4)
color="Red"
else
color = "Blue";

return color;
}
May 20, 2013 at 5:20pm
There is such thing as a compiler. Compile your program and the compiler will report all syntax errors.
May 20, 2013 at 5:28pm
Where is the question? Seems like you need to do your own exam or do all of us who actually want to learn a favor and find a new career
Topic archived. No new replies allowed.