MCQ Cs C PDF
MCQ Cs C PDF
MCQ Cs C PDF
member
B.
adjuster
C.
manipulator
D.
operator
a space
B.
C.
an asterisk (*)
D.
a null character
a first-in-first-out approach
B.
C.
a member name
D.
an index number
6. To hide a data member from the program, you must declare the data member in the _____
section of the class
A.
concealed
B.
confidential
C.
hidden
D.
private
E.
restricted
B.
flowcharts
C.
IPO charts
D.
pseudo code
E.
a pointer to a structure
B.
a reference to a structure
C.
a copy of a structure
D.
nothing
zero bytes
B.
one byte
C.
three bytes
D.
four bytes
one
B.
two
C.
three
D.
unlimited
11. Which of the following formulas can be used to generate random integers between 1 and
10?
A.
1 + rand() % (10 - 1 + 1)
B.
1 + (10 - 1 + 1) % rand()
C.
10 + rand() % (10 - 1 + 1)
D.
10 + rand() % (10 + 1)
B.
C.
D.
13. Which of the following will store the number 320000 as a Float number?
A.
B.
C.
D.
14. The arguments that determine the state of the cout object are called
A.
classes
B.
manipulators
C.
D.
state controllers
is true
B.
is false
C.
is wrong
D.
16. Which of the following statements declares a variable that can contain a decimal number?
A.
dec payRate;
B.
dec hourlyPay
C.
float payRate
D.
float hourlyPay;
B.
C.
D.
18. A program will have one function prototype for each function defined in the programmerdefined section of the program. (Assume that the programmer-defined section is located
below the main function.)
A.
true
B.
false
19. The standard input stream, which refers to the keyboard, is called
A.
cin
B.
cout
C.
stin
D.
stout
data type
B.
order
C.
subscript
D.
symbol
B.
C.
D.
parentheses
B.
angle brackets
C.
curly brackets
D.
square brackets
23. Which of the following type casts will convert an Integer variable named amount to a
Double type?
A.
(double) amount
B.
C.
int to double(amount)
D.
data coupling
B.
control coupling
C.
external coupling
D.
pathological coupling
Visual C++
B.
137.45
C.
D.
2,365
E.
26. Which of the following, if any, are valid names for variables?
A.
class
B.
friend
C.
#OnHand
D.
void
E.
27. You have assigned the address of Value to the pointer P, Which statement will display the
value stored in Value?
A.
cout<<P;
B.
cout<<*Value;
C.
cout<<&P;
D.
cout<<*<P;
28. The void specifier is used if a function does not have return type.
a.
True
b.
False
29. You must specify void in parameters if a function does not have any arguments.
a.
True
b.
False
True
b.
False
True
B.
False
32. Does this mentioning array name gives the base address in all the contexts?
A.
Yes
B.
No
Yes
B.
No
34. Are the expressions arr and &arr same for an array of 10 integers?
A.
Yes
B.
No
35. The keyword used to transfer control from a function back to the calling function is
A.
switch B.
goto
C.
go back
D.
Answer:-
1. B
2. B
3. C
4. D
5. D
return
6. D
7. A
8. A
9. B
10. D
11. A
12. A
13. A
14. C
15. A
16. D
17. C
18. A
19. A
20. C
21. B
22. C
23. A
24. A
25. E
26. E
27. D
28. A
29. B
30. B
31. A
32. B
33. B
34. B
35. D