1. How many sequence of statements are present in c++?
a) 4
b) 3
c) 5
d) 6
2. The if..else statement can be replaced by which operator?
a) Bitwise operator
b) Conditional operator
c) Multiplicative operator
d) none of the mentioned
3. The switch statement is also called as?
a) choosing structure
b) selective structure
c) certain structure
d) none of the mentioned
4. The destination statement for the goto label is identified by what label?
a) $
b) @
c) *
d) :
5. What is the output of this program?
a) 543
b) 54
c) 5432
d) 53
6. What is the output of this program?
a) 1010
b) 10
c) infinitely print 10
d) compile time error
7. What is the output of this program?
a) error
b) 15
c) infinite times of printing n
d) none of the mentioned
8. What is the output of this program?
a) 0123456789
b) 10
c) 012345678910
d) compile time error
9. How many types of loops are there?
a) 4
b) 2
c) 3
d) 1
10. Which looping process is best used when the number of iterations is known?
a) for
b) while
c) do-while
d) all looping processes require that the iterations be known
a) 4
b) 3
c) 5
d) 6
2. The if..else statement can be replaced by which operator?
a) Bitwise operator
b) Conditional operator
c) Multiplicative operator
d) none of the mentioned
3. The switch statement is also called as?
a) choosing structure
b) selective structure
c) certain structure
d) none of the mentioned
4. The destination statement for the goto label is identified by what label?
a) $
b) @
c) *
d) :
5. What is the output of this program?
#include <iostream>
using namespace std;
int main ()
{
int n;
for (n = 5; n > 0; n--)
{
cout << n;
if (n == 3)
break;
}
return 0;
}
b) 54
c) 5432
d) 53
6. What is the output of this program?
#include <iostream>
using namespace std;
int main()
{
int a = 10;
if (a < 15)
{
time:
cout << a;
goto time;
}
break;
return 0;
}
b) 10
c) infinitely print 10
d) compile time error
7. What is the output of this program?
#include <iostream>
using namespace std;
int main()
{
int n = 15;
for ( ; ;)
cout << n;
return 0;
}
b) 15
c) infinite times of printing n
d) none of the mentioned
8. What is the output of this program?
#include <iostream>
using namespace std;
int main()
{
int i;
for (i = 0; i < 10; i++);
{
cout << i;
}
return 0;
}
b) 10
c) 012345678910
d) compile time error
9. How many types of loops are there?
a) 4
b) 2
c) 3
d) 1
10. Which looping process is best used when the number of iterations is known?
a) for
b) while
c) do-while
d) all looping processes require that the iterations be known