CBSE Class 11 Computer Science Sample Paper 2018
CBSE Class 11 Computer Science Sample Paper 2018
CBSE Class 11 Computer Science Sample Paper 2018
com
CLASS – XI M.M.: 70
TIME : 03.00 HRS
SUBJECT: COMP.SC.(083)
General Instructions:
a) All questions are compulsory.
b) Programming Language : C++
a2 + b2 + c2
f. Define : 2
i. Keyword
ii. Identifier
g. Which header files are required for the following? 2
(i) pow ( ) (ii) strcmp( )
(iii) isalpha( ) (iv) getch( )
3. a. What is the role of comment and indentation in a program? Explain 3
with suitable examples.
b. What is the difference between syntax error and a semantic error? 2
c. What do you understand by program maintenance? Explain its types. 3
d. What is robustness? 1
e. What are the stages of program development process? Explain each. 3
4. a. What is ‘void’? 1
b. Give the possible outputs of the following program segment: 1
int N= random(3);
cout<<N;
largest.
e. What is source code? 1
f. What output will be the following code fragment produce? 2
void main( )
{
int val, res, n=1000;
cin>>val;
res = n+val>1750 ? 400 : 200;
cout<<res;
}
(i) if val=2000 (ii) if val=500
if ( ch = = ‘E’)
east + + ;
if ( ch = = ‘W’)
west + +;
if ( ch = = ‘N’)
north + +;
if ( ch = = ‘S’)
south + +;
else
unknown + +;
Q2 a) Variable: named memory location which can hold a value of particular data type 2
Declare : data-type varname; e.g. int sal;
Initialized : first value assigned to a variable. e.g. int a=20;
1 mark for each part
b) Unary : Single operand, a++ 3
Binary : Two Operand, a+b
Ternary : three Operand, conditional operator
1 mark for each operator with example
c) 32, 3 ( 1 mark for each correct answer) 2
d) data types are the means to identify the type of data 2
i)fundamental data type ii) derived data type
( 1 mark for definition and 1 for its types)
e) Sqrt(a*a +b* b +c* c) 1 mark for correct answer 1
f) 1 mark for each correct answer 2
g) (i) math.h (ii) string.h (iii) ctype.h (iv) conio.h 2
½ mark for each
c= a+b;
cout<< c;
}