Surgery MCQs from Belly & Love Book.Full description
-Full description
ds queuwFull description
net paper1Full description
physics
gate
DFD
Mas
solutionDescrição completa
gate upto 2012 emDescrição completa
Alarms With SolutionsDescrição completa
1. What is the only function all C++ programs must contain? A. start()
B. system()
C. main()
D. program()
Ans c 2. What punctuation is used to signal the the beginning and end of code blocks? blocks? A. { }
B. -> and <-
C. BEGIN and END
D. ( and )
Ans- a 3. Which of the following following is a correct comment? A. */ Comments */
B. ** Comment **
C. /* Comment */
D. {Comment}
Ans- c 4. Evaluate !(1 && && !(0 || 1)). A. True
B. False
C. Unevaluatable Ans- a 5. Which of the following following is not not a correct variable type? A. float
B. real
C. int
D. double
Ans- b 6. The difference difference between between x and x is a. The first one refers to a variable whose whose identifier is x and the second second one refers to to the character constant x. b. The first one one is a character character constant x and second one is the string literal x c. Both are same d. None of above
Ans a 7. What is output of follwoing int main() { cout << "R4R" << endl; return 0; } a. Execution time error
b. Syntax error
c. R4R
d. None
Ans- b
8. We declare a function with ______ if it does not have any return type a. long
b. double
c. void
d. int
ans- c 9. The keyword endl a. Ends the execution of program where it is written b. Ends the output in cout sta tement c. Ends the line in program. There can be no statements after endl d. Ends current line and starts a new line in cout statement. Ans- d 10. Overloaded functions are
a.
Very long functions that can hardly run
b.
One function containing another one or more functions inside it.
c.
Two or more functions with the same name but different number of parameters or type.
d.
None of above
ans- d 11. C contains two special pointer operators: a. * and &
b. * and &&
c. & and &&
d. % and &
Ans- c 12. Main() is an example of a. library function
b. user-defined function
c. header
d. statement
ans- a 13. In which statements, does a CONTINUE statement cause the control to go directly to the test condition and then continue the looping process? a. FOR and WHILE
b. WHILE and IF-ELSE
c. DO-WHILE and IF-ELSE
d. While and DO-WHILE
ans- d 14. Find out the incorrect statement for strlen() function a. Returns the length of a string b. Does not count the null terminator c. Has general form strlen(); d. All of above ans- a
15. The advantage of a SWITCH statement over an ELSE-IF statement a. A default condition can be used in the SWITCH b. The SWITCH is easier to understand c. Several different condition can cause one set of statements to be executed in a SWITCH d. Several different statements can be executed in a SWITCH e. None of above ans- b
16. To increase the value of c by one which of the following statement is wrong? a. c++;
b. c = c + 1;
c.
d. c += 1
c + 1 => c;
ans- c 17. Find out the error in following block of code. If (x = 100) Cout << x is 100; a. b. c. d.
100 should be enclosed in quotations There is no semicolon at the end of first line Equals to operator mistake Variable x should not be inside quotation
ans- c 18. Code: int a=10,b; b=a++ + ++a; printf("%d,%d,%d,%d",b,a++,a,++a); what will be the output when following code is executed a.12,10,11,13 c.12,11,11,11
b.22,10,11,13 d.22,13,13,13[Ans]
19. How many classes occurs in the concept of inheritance a.2 c.3 Ans- a 20. A FRIEND function is a a. Static function b. Member function Ans- b