CBSE Guess > Papers > Important Questions > Class XII > 2010 > Computer Science > Computer Science By Ravi Kiran CBSE CLASS XII f. In the following program, find the correct
possible output(s) from the options: 2 Ans: Outputs: Ans: Since random(2) gives either 0 or 1, ToGo
value will be either 1 or 2.
(random(n) gives you any number between 0
to n-1)
Area[1] is “SOUTH”. Area[2] is “EAST”.
Since I value from 0 to 2 (ie<3), 3 iterations
will takes place.
So the possible output consists 3 strings
separated by :, each of them may be either“SOUTH” or “EAST”. 2007 Delhi Q.1.a. Differenctiate between a Run Time Error and Syntax Error. Also give suitable examples of each in c++. Ans: Run Time Errors: Errors that occur
during the execution of a program are called
as run time errors. It is caused of some illegal
operation taking place or inavailability of
desired or required conditions for the Syntax Errors: (ii) cin<<a; In this statement, since stream insertion operator (<<) has given instead of stream extraction operation(>>), there will occurs a syntax error. Paper By Mr. Ravi Kiran |