0% found this document useful (0 votes)
33 views1 page

Second Year Test 2

Uploaded by

bareeraibraheem
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)
33 views1 page

Second Year Test 2

Uploaded by

bareeraibraheem
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/ 1

KIPS

KAMRA CAMPUS

COMPUTER XII

NAME ROLL No. SECTION


SECTION – A (Marks 08)

Q1. Choose the best option and fill the relevant bubble from following.

1. Which of the following is the correct syntax to declare a variable in C++?


a. int x; b. x=int; c. var int=x; d. None of these ⓐ ⓑ ⓒ ⓓ
2. What is the purpose of the #include directive in C++?
a. Include b. Include c. Declare d. Initialize ⓐ ⓑ ⓒ ⓓ
header files functions variables variables
3. Which keyword is used to declare a constant in C++?
a. Constant b. Const c. Immutable d. Final ⓐ ⓑ ⓒ ⓓ
4. Calculate the value of x from (a=5; x=++a)
a. 5 b. 6 c. 4 d. 7 ⓐ ⓑ ⓒ ⓓ
5. Which of the following is ignored during compilation
a. Reserve b. Comments c. Header files d. Variables ⓐ ⓑ ⓒ ⓓ
Words
6. The number of bytes reserved for int in C++ are
a. 2 b. 4 c. 8 d. 10 ⓐ ⓑ ⓒ ⓓ
7. Which one is not the valid variable in C++
a. X5; b. A-6; c. Net_pay; d. All of these ⓐ ⓑ ⓒ ⓓ
8. In C++ sum=sum+n can also be written as
a. sum=+n b. sum+=n c. n=+sum d. None of these ⓐ ⓑ ⓒ ⓓ

----------------------------------------------------------------------------------------------------------------------------------

SECTION – B (Marks 4*3=12)


Q2. Attempt All the Questions. Each Question carry equal marks.

1. Differentiate between relational and logical operators?


2. Define post fix increment operator with the help of an example?
3. What would be the output of following statement
cout<<”The result is “<<endl<<15/7;
4. Define ternary operator? Also write down its general form?
SECTION – C (Marks 5*2=10)

Q3. Attempt All the Questions. Each Question carry equal marks.

1. Write a C++ program that inputs 4 integers from user and print their sum and product.
2. Evaluate the following
a. x=5; y=6; z=++x; a=y--; {find the value of x,y,z,a}
b. 7+2*6-5%3-8

You might also like