You are on page 1of 1

S P EC T R U M S T U D Y C I R C L E

15/22 2ND FLOOR ASHOK NAGAR ND-18 (PH – 55711031, 9810378235)

XI C++ SERIES 3 VINOD GANDHI

Instructions Attempt All Questions MM: 30


PROGRAMMING LANGUAGE IS C++ Time: 1 hour

Q1. Explain the structure of “FOR – LOOP”, “WHILE –LOOP”, “SWITCH-CASE” with similarities
and difference between all. Write the code for printing “FIBONOCCT SERIES” 0 1 1 2 3 5 8
............. using Switch case . 5

Q2. Write the program in C++ to check wheather the given string is palindrom or not 5
Or
Write the program in C++ to reverse the given digit. For example if user Enters 123,
output should be 321

Q3. What are the difference between IF block, If – else block and Nested If block. Which one is
best?
Write code for functioning of a calculator using If – block 5

Q4. Write program in C++ to print


*
* *
* * *
* * * * 5

Q5. Find Errors, Re-write code ( in C++) 5


(a) void main ()
{
float r, s, t,
r = s/t ;
cin >> r<< t ;
cout >> “ Answer is : ” >> r ;
return 0 ;
}

(b) switch ( int ch > 0 )


{
case A : cout << “A” ;
break ;
CASE B :
case C : continue ;
9: cout << “1n WRONG CHOICE” ;
return 0 ;
}
Q6. Write Program in C++ to check wheather the given year is leap year or not. Using both
do-
while loop and Switch case and explain the dry output. 5
Or
Explain Data Abstraction, Data Encapsulation, Modularity, Inheritance and Polymorphism

You might also like