You are on page 1of 4

KV NO 1 MADURAI , HALF YEARLY EXAMINATION 2013-14

SUB : COMPUTER SCIENCE


1 a)

CLASS : XI

TIME 3 hrs

M.M: 70

Arrange the following computers according to first to fifth


generation of computers
PDP 1 , MARK 1, Note Book Computer , CRAY 1, IBM 307

Expand the following


i)
UNIVAC
ii)
VIRUS
How does Impact Printers differ from Non-Impact Printers? Give
examples

d)

Classify the Computers according to their storage capacity and size

e)

Explain the different communication parts used in system with


their respective peripherals

f)

Convert the following to other number system


i)
(1208)10 =()8
ii) (110110111)2=()16
iii) (101.01)2=()10
Perform the following
operations
i)
11011001 +
ii) 110111 110111
1010

What is meant by const keyword? Illustrate with help of an


example

b)

Given the following code fragment:


int ch = 20;
cout << ch << ++ ch << ch << \n;
(i) The output of the code fragment.
(ii) What is the effect of replacing ++ ch with ch + 1?

c)

In the following program, if the value of N given by the user is 20,


what maximum and minimum value the program could possibly

b)
c)

g)

2 a)

d)

e)

3 a)

b)

display ?
#include<iostream.h>
#include<stdlib.h>
void main()
{
int N, Guessme;
randomize();
cin>>N;
Guessme = random(N-10) + 10 ;
cout<<Guessme<<endl;
}
Name the header files required to execute the following program
segment
void main()
{
int n;
cout<<"Enter a number";
cin>>n;
if(n==0)
exit(0);
cout<<"Square of n is "<<setw(5)<<pow(n,2);
}
Differentiate between the
(2 * 4) =
following
iii) !
&&
i)
::
?:
ii) extern automatic
iv) break continue

Convert the following nested if to switch case


if(d==1)
cout<<"Monday";
else
if(d==2)
cout<<"Tuesday";
else
if(d==3)
cout<<"Wednesday"
else
cout<<"--";

Convert the following loop into do-while

for(int i=0;j=15;i<5;i++;j--)
{
if(i%3==0)
cout<<i<<" & "<<j<<endl;
}
c)

Give difference between pre and post increment operator.


Illustrate with help of example each.

d)

Rewrite the below code after removing the syntax error. Underline
the corrections made and state the error(s). (Header files assumed
to be included)
Void main
{
int i=15 ; j=30 ;
if( i + j % 2 ) ;
cout<<"sum is "i+j;
getch()
}

e)

Write a program to check whether a triangle is valid or not, when


the three angles of the triangle are entered by the user. A triangle
is valid if the sum of all the three angles is equal to 180 degrees.

f)

Write a program to calculate the sum of following series where n is


input by user.
1 + 1/2 + 1/3 + 1/4 + 1/5 + +1/n

What is meant by sizeof() operator?Give suitable example

Read the following code and state its output


void main()
{
int arr[]={5,2,11,7,8,9};
clrscr();
for(int i=5;i>=0;i--)
cout<<arr[i]<<" ";

4 a)
b)

cout<<endl;
for(i=0;i<6;i++)
if(arr[i]%2)
arr[i]++;
for(i=-;i<6;i++)
cout<<arr[i]<<" ";
c)
d)
e)
f)
5 a)

b)

}
Draw a flowchart to find whether the given dimensions (a , b) form
a square of rectangle.
Explain the use of connector in a flowchart. Illustrate with an
example
Write a program to compute area of triangle. Sides (a,b,c) are input
by user.
Area = sqrt(s*(s-a)*(s-b)*(s-c))
where
s=(a+b+c)/2.
What is the difference type conversion and type casting? Illustrate
with the help of suitable example

3
2
4
3

What is an Array? How does it differ from a normal variable? What


are the various ways of initializing an array? With an example show
how to input and output elements in an array. Draw block
diagrams wherever required

Write a program to interchange the elements of a given array as


shown below
A = 10 13 24 65 17 38 19
after change it should be
A = 13 10 65 24 38 17 19
(adjacent element interchange , if odd numbers last element
remains unchanged)

ALL THE BEST

You might also like