You are on page 1of 3

KENDRIYA VIDYALAYA NO 1,

KALPAKKAM
CLASS XII - COMPUTER SCIENCE
MM 50
DATE:
Time allowed : 1.5
hours
_______________________________________________________
Note:- (I) All questions are compulsory. (II)Programming Language : C++

SECTION A
Questions from 1 to 10 carries of 1 mark each.
1.
2.
3.
4.
5.

Write the difference between while and do-while?


What do you mean by function prototype?
What do you mean by call by reference?
What is recursion?
By default all the members of a structure are:(i)Public
(ii)Private (iii) protected
6. What is type modifier? Explain.
7. Give the output of the following program:void main()
{
int i=3; cout<<i+5<<i-4<<i<<endl;
}
8. Name the header file(s) that shall be needed for successful compilation of
the following C++ code
void main()
{ char String[20];
gets(String);
strcat(String,CBSE);
puts(String); }
9. What is the difference between a variable and a constant?
10. Briefly describe the importance of iostream.h file?

SECTION - B
Question from 11 to 18 carries of 2 marks each.
11. What is identifier? Write down naming convention of identifiers.
12. What is data type? Explain different types of data type available in C++.
13.
What is conditional operator? Explain with the help of an example?
14. What is the difference between Array and Structure?
15. Explain switch statement by using suitable example.
16. Construct function prototype for descriptions given below.
test() - takes no arguments and returns an int.
convert() - takes a float arguments and returns a double.
sum() - takes an int array and an int value and return a long result.
check() - takes a string argument and returns an int.
17.

State why are following expressions invalid?

(i)asm=5100 || val<35 (ii) age>70 && <90


(iii) income>=5000 || && val>500 (iv) res !>2011 && !x>20
18.

Give the output of the following-

#include<iostream.h>
void execute(int & x, int y=200)
{

int temp=x+y;

x+=temp;

if(y!=200) cout<<temp<<x<<y<<endl;
}
void main()
{

int a=5050,b=20;

execute(b);cout<<a<<b<<endl;
execute(a,b); cout<<a<<b<<endl;
}

SECTION C
Question from 19 to 21 carries of 3 marks each.
19. What do you mean by operator? Explain different types of operators with
example?
20. Find syntax errors, if any, in the following program and correct them.
(i)
include<iostream.h>
(ii) include<iostream.h>
main()
void main()
{
{
int x[5],y,z(5);
int x,y; cout>>x;
for(i=0;i<5;i++);
for(x=0;x<5;++x)
{
x[i]=i;

cout y else cout<<x<<y;


z[i]=i+3;

y=x[i]+z[i] }
cout<<y=y;
21.

name the header file, to which following built-in functions belong to


(I) strcpy()
(ii)gets()
(iii)strcmp()
(iv)getc()
(v)isupper() (vi)sqrt()

SECTION D
Question from 22 to 24 carries of 4 marks each.
22. Write a program to find whether the input no is prime of not.(prime
number is the number which will be completely divided by 1 or itself only).
23. Write a program to check whether the input matrix is unit matrix or not?
24. Write a function that will take an array of 50 numbers (all should be in a
range of 0 to 50) and will display how many are in following range-

40-50,

25-39,

10-24,

0-9.

You might also like