CBSE eBooks CBSE Guess > eBooks > Class XII > Computer Science By . Mr. MRK
Chapter – 1 C++ Revision Tour Outputs:
Ans: Since random(2) gives either 0 or 1, ToGo value will be either 1 or 2. 2007 Delhi : 1.a. Differenctiate between a Run Time Error and Syntax Error. Also give suitable examples of each in c++. 2 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 execution of the program. For instance, if a program is trying to open a file which does not exist or it could not be opened, it results into an execution error. Similarly, if enough memory is not available or an expression is trying to divide a number by zero are run-time errors. Eg: Division by zero. Syntax Errors: Syntax errors occur when rules of a programming languages (syntax) is misused. Ie when a grammatical rule of C++ is violated. Eg (i) c=a+b 1.b. Name the header file(s) that shall be needed for successful compilation of the following C++ code. 1 void main( ) Ans: stdio.h string.h |