Friday, July 24, 2009

C Objective type Questions and Answers

Previous Next


Which symbol is used to make comments ?
a. //
b. #
c. !!

Ans a

How would you insert pre-written code into a current program ?
a) #read
b) #get
c) #include
d) #pre
Ans: C

Which symbols represent a block of code ?
a) { ... code here }
b) ( ... code here )
c) [ ... code here ]
d) < ... code here >
Answer is : B

In which standard library file is the function printf() located ?
a) stdlib.h
b) stdio.h
c) stdout.h
d) stdoutput.h
Answer is :B

In order to properly use a variable...
a) The variable must have a valid type.
b) The variable name can not be a keyword (part of the C syntax).
c) The variable name must begin with a letter.
d) All of the above.
Answer is :D

Which mathematical operators are in the correct order ?
a) Addition, Division, Modulus
b) Division, Multiplication, Modulus
c) Modulus, Multiplication, Subtraction
d) Modulus, Addition, Division
Answer is :C

Which of the following are NOT relational operators ?a) >
b) <>Answer is :C

The first expression in a for loop is ?a) The test expression.
b) The step value of the loop.
c) The value of our counter variable.
d) None of the above.
Answer is : C

What is the break statement used for ?a) To quit the program.
b) To quit the current iteration.
c) To stop the current iteration and begin the next iteration.
d) None of the above.
Answer is :B

What is the continue statement used for ?
a) To continue to the next line of code.
b) To stop the current iteration and begin the next iteration from the beginning.
c) As an alternative to the else statement.
d) None of the above.
Answer is :B


Previous Next

No comments:

Post a Comment