Professional Documents
Culture Documents
I.Choose The Correct Answer: 35 X 1 35: Optim Test - 3
I.Choose The Correct Answer: 35 X 1 35: Optim Test - 3
a)2
b)2.33
c)0
d) a and b
29. for(int I = 1;i<50;i++); The loop will be executed ____ times.
a) 48
b)49
c)50
d)47
30. Inner and outer loop may not have same control variable as it will lead to ___ error.
a)syntax
b)runtime
c)compilation
d)logical
31. The ___ instructs the compiler to store the variable in the CPU registers to optimize
access.
a) auto
b) static
c)extern
d) register
32. ___ is called as exit-check loop.
a)while
b) if
c) for
d) do- while
33. How many storage specifiers are there in C++
a) 1
b) 2
c) 3
d) 4
34. Static and register variables are automatically initialized to ____ value when they are
declared.
a) 0
b) 1
c) null
d) -1
35. switch expression should be evaluated on ___ constants only.
a) int
b) float
c) char
d) void
ANSWER ANY TEN OF THE FOLLOWING:
10 X 2
= 20
36. What is enumeration. Specify with syntax and example.
37. Write short notes on The extraction operator.
38. Debug the program.
#include<IOSTREAM.H>
main[]
{
Int a,b;
cin<< \n Enter two numbers ;
result := a* b;
cout<<\n<<Result;
}
39. Differentiate entry check loop and exit check loop.
40. What are the rules to be followed while writing variable names.
41. Write the syntax of switch case statement./
42. Evaluate the expression where a=5, b=6, c=7.
b += a%2*c
43. What are the rules for the formation of nested loops.
44. Define conditional operator with example.
45. What are the sections of C++ program.
46. Explain the types of operator classification based on operand requirements.
47. What are control structures.
ANSWER ANY FOUR OF THE FOLLOWING:
4X5
= 20
48. Explain the various forms of if statement.
49. Explain the types of loops in C++ with example.
50. Explain the steps involved in program development of C++ programs.
51. Explain in detail the data types of C++
52. How many storage specifiers are there in C++. Explain in detail.
53. Give a detailed explanation on the operators used in C++.
54.Answer the following questions based on the program
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int num =2;
do
{
cout<<num * num<<\t;
num += 1;
}while(num>6);
getch();
}
a)Identify the
(i) control variable used
(ii) identify the statements that form the body of the loop.
(iii) the test expression.
b)How many times the loop be executed.