Professional Documents
Culture Documents
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.
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.
#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;
y=x[i]+z[i] }
cout<<y=y;
21.
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.