0% found this document useful (0 votes)
94 views

Cs PDF

The document is a mock exam paper for Class 11 Computer Science. It contains 8 questions with multiple parts about programming concepts in C++ like data types, operators, conditional statements, loops, functions, arrays and more. Students are asked to write programs, find outputs, explain concepts, solve algorithms, perform conversions between binary, decimal, hexadecimal and octal number systems.

Uploaded by

divya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views

Cs PDF

The document is a mock exam paper for Class 11 Computer Science. It contains 8 questions with multiple parts about programming concepts in C++ like data types, operators, conditional statements, loops, functions, arrays and more. Students are asked to write programs, find outputs, explain concepts, solve algorithms, perform conversions between binary, decimal, hexadecimal and octal number systems.

Uploaded by

divya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

St.

Cecilias Public School


Half-Yearly Examination (Mock Paper)
Subject: Computer Sc.
Class XI
Session: 2016-17
Max. Marks : 70 Time allowed :3 hrs.
Note :
1. All questions are compulsory.
2. Programming Language : Use C++

1. (a) Name the header file to which the following belong : (2)
(i) setw() (ii) exp()
(iii) tan() (iv) getch()

(b) Illustrate the use of comments and indentation in a c++ program with the help of an example.
(2)
(c) Rewrite the following program after removing the syntactical error(s), if any.
Underline each correction. (4)
#include[iostream.h]
void MAIN()
{
int a=b=c=0;
cin>>a,b,c;
if a<b
cout>>a>>b>>c>>endl;
Else
cout<<d-a<<endl;
}
(d) Find the output of the following program : (2)
#include<iostream.h>
void main()
{
int x=3,y=5;
cout<< ++x << << y-- <<endl;
y+=6;
cout<< x-- << << ++y<<endl;
}

(e) What will be the output of the following expression if (2)


(i) ans=200,val=100 (ii) ans=800,val=200 ?

ans + val < 600 ? 1650 :1050

(f) Give use of cascading of insertion/extraction operators with the help of an example. (2)

1
(g) State valid/invalid for the following identifiers ,give reasons for invalidity : (3)
(i) 2roll (iv) S.I.
(ii) _111 (v) Date of Birth
(iii) default (vi) Del-Key

(h) State valid/invalid for the following literals ,give reasons for invalidity : (3)
(i) .54 (iv) \x67
(ii) computer (v) Technology
(iii) 13E-1.5 (vi) 5+3

2. (a) Explain type casting with the help of an example. (2)

(b) Write a program to convert temperature given in Fahrenheit to Celsius. (3)

(c) Write a C++ program to input a number. If the number is even and positive, print its square
root otherwise print its cube.(use conditional operator only) (3)

(d) Write the result of the following expressions: (5)


(i) (2<7) || (5>=5)
(ii) (18>=3 && 4!=9)
(iii) !(13!= 14)
(iv) 230 > 300 ? 70 : 80
(v) (x =4 , x + 5)

(e) Find the output of the following program : (2)


#include<iostream.h>
void main()
{
long num=1239089;
int F=0, S=0;
do
{
int Rem=num%10;
if ( Rem%2 !=0)
F +=R;
else
S +=R;
Num /=10;
}while ( num > 0);
cout<< F-S;
}

3. (a) Write an algorithm to check whether a given number is prime or not. (4)

(b) Write an algorithm to find the sum of the following series upto n terms: (3)
2 , 3 , 5 , 8 , 12, 17.

2
(c) Write a program to calculate and print the sum of the series :
1 + x2 + x4 + x6 +..upto n terms (3)

(d) Write a program to input a month number and print it in words (1-January, 2-February etc.)
(3)

4. (a) Write a program to display the first n terms of the Fibonacci series. (4)

(b) Write a program to find the factorial of a positive integer N. (4)

(c) Find the output obtained by the following statements. Also write a for loop
for obtaining the same output : (4)

int val=2;
cout<<val-1<<endl<<val+1;
val+=3;
cout<<endl<<val++<<endl;
cout<<++val<<endl;

5. (a) Give the ASCII codes for the following: (1)


(i) h
(ii) 6

(b) Convert the following into their binary equivalent : (3)


(i) (24.61)8
(ii) (AC.E)16
(iii) (45.38)10

(c) Convert the following into their decimal equivalent : (3)


(i) (37.5)8
(ii) (3F.A)16
(iii) (11011.11)2

(d) Convert the following into their octal equivalent : (2)


(i) (10110.1011)2
(ii) (57.9)10

(e) Convert (101011.101)2 into its hexadecimal equivalent. (1)

*******************

You might also like