Ii Ut Xi CS

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

KENDRIYA VIDYALAYA NTPC DADRI II UNIT TEST-2011 COMPUTER SCIENCE (THEORY) CLASS XI

Time Allowed: 90 Min. Max Marks 40 2 3 3 3 1. Answer the following questions: a. What are identifiers in C++? Give two examples. b. What is Type conversion? Explain implicit type conversion & Explicit Type Conversion with an example of each? c. Identify invalid variables among the following, give reasons: (i) 123gh (ii) XI A (iii) vivek (iv) _123 (v) 123_ (v) cout d. Differentiate between(with an example): i)= & == ii) Relational Operator & Logical Operator iii) unary & binary operator e. What would be of output of each of the following written in C++ i. cout<< 3 + 7 * 5 12; ii. cout<< a++ + a ++ + a; //(initially, a=5) iii. cout<< 3.89 % 3; iv. cout<< 5 * 2 % 3 + 3 % 2 * 5; 2. What be the character size of the following constants: \a, \a, sachin\s bat. f. Identify the errors in the following program
#include iostream.h main() { clrscr(); integer a=50, b= 40, c; if a > b a += 50; b = b-30; else b = b-50; cout<<c; getch; }

2 3

2. i) ii) iii) iv)

Explain the following: Polymorphism Data Abstraction Data Encapsulation Inheritance How are these concepts implemented in C++?

3. Answer the following questions: a) What is sizeof() operator? Explain with example. b) Write the corresponding C++ expressions for the following mathematical expressions: i) a2+b2+c2 ii) ex x 2 ii) 2-4y*(P+Q) iv) (r+s)4

1 2

c) Evaluate the following expressions, where a,b,c are integers & d,f are floating point numbers. The value of a=5, b=3, & d=1.5 : i) F=(a++)*d+a ii) F=(++b)*b-a d) Using the given values of x, y & z, evaluate the following(Answer in True/False) : (x>=y) || (!(z==y)&&(z<x)) i) x=10,y=5,z=11 ii) x=9,y=10,z=2 a) Fill in the blanks: i) (1001.101)2=(_______)10 ii) (354)8=(______)2 iii) (A6D12)16=(____)8 b) Write the 2s Complement form of the following binary numbers: 100010111, 11101

4.

You might also like