C Programming: MCQ Set – 02

Q11: Which one of the following sentences is true ?

  • (A) The body of a while loop is executed at least once.
  • (B) The body of a do … while loop is executed at least once.
  • (C) The body of a do … while loop is executed zero or more times.
  • (D) A for loop can never be used in place of a while loop.

Q12: A pointer variable can be

  • (A) Passed to a function as argument
  • (B) Changed within function
  • (C) Returned by a function
  • (D) Assigned an integer value

Q13: The language that the computer can understand and execute is called

  • (A) Machine Language
  • (B) Application Software
  • (C) System Program
  • (D) Assembly language

Q14: The expression P >> 6 shifts all bits of P six places to right. What is the value of P >> 6 if P 0.6db7 ?

  • (A) 0.1234
  • (B) 0.0001
  • (C) 0.0000
  • (D) 0.1B6

Q15: The process of production of customer list in alphabetical order falls under the category of

  • (A) Editing
  • (B) Sorting
  • (C) Updating
  • (D) Calculating

Q16: The control automatically passes to the first statement after the loop in

  • (A) Continue statement
  • (B) Break statement
  • (C) Switch statement
  • (D) If statement

Q17: What would be the output of the following program, if run from the command line as “myprog 1 2 3” ?

main (int argc, char * argv[ ])
{ int i ;
i = argv[1] + argv[2] + argv[3] ;
printf (“% d”, i) ;
}
  • (A) 123
  • (B) 6
  • (C) Error
  • (D) “123”

Q18: Output of the program given below is

int i;
main()
{
printf(“%d”, i)
  • (A) 1
  • (B) 0
  • (C) -1
  • (D) NULL

Q19: Determine which of the following is a valid character constant

  • (A) ‘\\’
  • (B) ‘\0’
  • (C) ‘xyz’
  • (D) ‘\052’

Q20: Is the following statement a declaration or definition? extern int i;

  • (A) Declaration
  • (B) Definition
  • (C) Function
  • (D) Error

Answer:

QuestionQ11Q12Q13Q14Q15Q16Q17Q18Q19Q20
AnswerBCADBBCBAA

≪ Previous | Next ≫