Download - Kendriya Vidyalaya NKJ Katni

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Approximations of π wikipedia , lookup

Positional notation wikipedia , lookup

Elementary arithmetic wikipedia , lookup

Halting problem wikipedia , lookup

Addition wikipedia , lookup

Elementary mathematics wikipedia , lookup

Transcript
KENDRIYA VIDYALAYA SANGATHAN JABALPUR REGION
HALF YEARLY EXAMINATION DECEMBER 2013
Subject: C o m p u t e r S c .
Time Allowed: 3 hours
Class: C l a s s X I
Maximum Marks: 70
1. (a) What do you mean by variables and constants?
2
(b) Name the other header files that shall be needed for the following code:
1
#include <iostream.h>
void main()
{
char ch='b'; int x=45;
x = log10(x);
cout<<ch<<setw(15)<<"Hello gets()"; }
(c) Rewrite the following program after removing the syntactical errors (if any). Underline each
correction.
2
#include <iostream.h>
void main()
{
char ch='b';
int x==45;
for(;;) break;
cout>>"Hello";
while (6) break;
cin<<ch;
ch=c;
}
(d) Find the output of the following C++ program.
3
#include <iostream.h>
void main() {
int x=10;
for(;x<100;x+=10)
{
if(x%4==0)
cout<<x<<endl;
else
cout<<x+10;
}
}
2 (a) Give two example of Super Computer of India?
(b) Convert following numbers.
2
6
(i) 725.250 decimal number into binary number
(ii) 111011.00101 binary number into decimal number
(iii) 1FF.1A Hexadecimal number into decimal number
(iv) -177 into 2’s complement number in 8 bit format
(c) Explain UNICODE and ASCII code.
2
(d) Write short note on Cache memories.
2
3. (a) Define
(i) Time sharing OS (ii) Real time OS
(ii) DOS
3
(b) Write a C++ program to print maximum and minimum number between n numbers. The
value of n is given at runtime.
3
(c) Write a C++ program that take a year as input print whether the year is leap year or not. 2
(d) Write the C++ program using loop to print the following pattern. One statement should print
one character at time.
2
1
22
333
(e) Write a C++ program that takes a number as input and print reverse of that number.
For exam. if input is 4523 then output will be 3254.
3
(f) Declare following variables.
3
(i) An Integer constant (ii) A reference variable to float
(iii) An unsigned integer
4. (a) Explain types of errors with one example of each.
4
(b) Give some stylistic guidelines for good program.
3
(c) Define Inheritance and Polymorphism.
2
(d) Define Lexical unit in C++.
1
5. (a) Write “Valid” if the following C++ identifiers are valid else write “Invalid” .
3
(i) register
(ii) class1
(iii) _34Name
(iv) Emp+name
(v) one_to_two
(vi) break3
(b) Write equivalent C++ statement for following mathematics statements.
2
(c) What are the effects of comments on complier.
1
(d) Explain the purpose of insertion and extraction operators in C++.
3
6. (a) What is the difference between for and while loops? Explain with examples.
3
(b) Write C++ program to calculate area of a triangle. Take the required parameters as input from
user. Area of triangle =
where s=(a+b+c)/2 and a, b and c are side of triangle. 3
(c) What is difference among switch and if statements?
3
7. (a) Write a function in C++ that takes two arguments and print all the even number between
these numbers and their sum.
3
(b) Write a C++ program to print a menu and calculate area, perimeter and diagonal of a rectangle
based on user choice(using switch case).
3