Thursday, July 30, 2009

Computer science help!!!!!!?

In the program below, what is the total number of syntax errors





/*


Program Name: simple.c


Program Author: Mitchell


Program Description: A simple program that adds two numbers and prints


the sum to the screen


/*





Void Main( void )


{


int num1 = 9;


int num2 = 8;





int numberSum = 0;





numberSum = num1 + num2;





printf( "The sum of the number is ", numberSum );





return;





} // end main














a. 3





b. 4





c. 5





d. 6

Computer science help!!!!!!?
actually studying at school is too much to hope for?
Reply:I see three errors that affect the compilation of the program, one more that might manifest itself depending on which compiler you use, one typo in the comments, and one grammatical error in the output message. So the bottom line is, the answer depends on your definition of "syntax error"...


No comments:

Post a Comment