Important Questions

CBSE Guess > Papers > Important Questions > Class XII > 2010 > Computer Science > Computer Science By Ravi Kiran

CBSE CLASS XII

Ans:

Output:
cbse*eXAM*3116
6113*MXAe*esbc

Q.1. f. Observe the following program SCORE.CPP carefully, if the value of Num entered by the user is 5, choose the correct possible output(s) from the options from (i) to (iv), and justify your option. 2
//Program: SCORE.CPP
#include<stdlib.h>
#include<iostream.h>
void main( )
{ randomize( );
int Num,Rndnum;
cin>>Num;
Rndnum = random(Num) + 5;
for(int N = 1;N<=Rndnum;N++)
cout<<N<<” “; }
Output Options:
(i) 1 2 3 4 (ii) 1 2
(iii) 1 2 3 4 5 6 7 8 9
(iv) 1 2 3

Ans:

Expected Output.

(iii) 1 2 3 4 5 6 7 8 9

2005 Outside Delhi

Q.1.b. Name the header files to which the following belong. (i) puts( ) (ii)isalnum( )

Ans:

(i) puts( ) - stdio.h (isalnum( ) - ctype.h

Q.1.c. Rewrite the following program after removing the syntactical error(s), if any. Underline each correction.
#include<iostream.h>
const int dividor 5;
void main( )
{ Number = 15;
for(int Count=1;Count=<5;Count++,Number -= 3)
if(Number % dividor = = 0)
cout<<Number / Dividor;
cout<<endl;
else
cout<<Number + Dividor <<endl;

Paper By Mr. Ravi Kiran
Email Id : [email protected]