Interview Questions

VARIABLES AND DATATYPES

Multiple Choice Questions

1. Which statement is correctly printing on console window?

 a) print(“word”);

 b) printf(‘word’);

 c) printf(“word”);

 d) prinft(“word”);

2. Which function is used to start program execution from first statement and terminate at last?

 a) #include<>

 b) int main()

 c) printf()

 d) return

3. What is a Token?

 a) Every smallest individual Unit

 b) Array of characters

 c) Basic building blocks in a program

 d) Pre-defined words

4. What is the size of float?

 a) 4 bytes

 b) 4 bits

 c) 8 bytes

 d) 8 bytes

5. What is a variable?

 a) Named memory locations

 b) Named for identification of function

 c) Name used for symbol

 d) None of above

6. Which is a valid syntax for declaring variable?

 a) Data_type variable_name;

 b) Variable_name data_type= value;

 c) Data_type variable_name= value;

 d) Variable_name data_type;

7. What is the difference between declaration and definition of a variable?

 a) Both can occur multiple times, but a declaration must occur first.

 b) There is no difference between them.

 c) A definition occurs once, but a declaration may occur many times.

 d) A declaration occurs once, but a definition may occur many times.

8. Which escape character can be used to begin a new line in C?

 a) /n

 b) \a

 c) \m

 d) \n

9. What is the output of following program?

 a) 2,4,1

 b) 4,4,1

 c) 4,2,2

 d) 2,4,2