Comment / // Comment / // Comment Both // Comment or / Comment
Comment / // Comment / // Comment Both // Comment or / Comment
a) /* comment */
b) // comment */
c) // comment
d) both // comment or /* comment */
Which of the following is the correct syntax to add the header file in the C++
4)
program?
a) #include<userdefined>
b) #include- [userdefined.h]
c) <include> "userdefined.h"
d) Both A and B
5)
Which of the following is the correct syntax to print the message in C++ language?
a) cout <<"Hello world!";
b) Cout << Hello world! ;
c) Out <<"Hello world!;
d) None of the above
11) Computers can do many different jobs because they can be _______
a) smart
b) programmable
c) thinking
d) non of the above
A(n) ___________ is like a variable, but its value is read-only and cannot be
18)
changed during the program’s execution.
a) secure variable
b) uninitialized variable
c) named constant
d) locked variable
A left brace in a C++ program should always be followed by a right brace later in
21)
the program.
a) TRUE
b) FALSE
c)
d)
25) 6-3*2+7-1 =?
a) 0
b) 2
c) 12
d) 6
26) 4 + 17 % 2 - 1 =?
a) 2
b) 4
c) 6
d) 8
27) (4 + 17) % 2 - 1 =?
a) 0
b) 1
c) 10
d) 20
31) int x=5; x=x+10; the value last stored in x will be (?)
a) 5
b) 10
c) 15
d) 20
32) int x=5; x=x/2; the value last stored in x will be (?)
a) 5
b) 2
c) 2.5
d) 1
33) double x=5; x=x/2; the value last stored in x will be (?)
a) 5
b) 2
c) 2.5
d) 1
34) int x=5; x+=5; the value last stored in x will be (?)
a) 5
b) 10
c) 15
d) 0
35) int x=5; x-=5; the value last stored in x will be (?)
a) 5
b) 10
c) 15
d) 0