MCQ on C Programming With Answers set-4


1. 'C' is often called a ....

A) Object oriented language

B) High level language

C) Assembly language

D) Machine level language


2. Each C preprocessor directive begins with ....

A) #

B) include

C) main()

D) {


3. C allows arrays of greater than two dimensions, who will determine this?

A) programmer

B) compiler

C) parameter

D) None of the above


4. The << operator is used for

A) Right shifting

B) Left shifting

C) Bitwise shifting

D) Bitwise complement


5. Set of values of the same type, which have a single name followed by an index is called

A) function

B) structure

C) array

D) union


6. Which of the following header file is required for strcpy() function?

A) String.h

B) Strings.h

C) file.h

D) strcpy()


7. scanf() can be used for reading ...

A) double character

B) single character

C) multiple characters

D) no character


8. A variable which is visible only in the function in which it is defined is called

A) Static variable

B) auto variable

C) external variable

D) local variable


9. In the loop structure logical expression is checked at the ....................of the loop.

A) first

B) end

C) middle

D) second


10. If an array is used as function argument, the array is passed

A) by value

B) by reference

C) by name

D) the array cannot be used as function argument


11. If is necessary to declare the type of function in the calling program if

A) Function returns an integer

B) Function returns a non-integer value

C) Function is not defined in the same file

D) Function is called number of times


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

A) \a

B) \m

C) \b

D) \n


13. Input/output function prototypes and macros are defined in which header file?

A) conio.h

B) stdlib.h

C) stdio.h

D) dos.h


14. What is the purpose of fflush() function?

A) flushes all streams and specified streams

B) flushes only specified stream

C) flushes input/output buffer

D) flushes file buffer


15. What does the following declaration mean?int(*ptr)[10].

A) ptr is array of pointers to 10 integers.

B) ptr is a pointer to an array of 10 integers

C) ptr is an array of 10 integers

D) ptr is an pointer to array





Answers:



1. 'C' is often called a ....

B) High level language

2. Each C preprocessor directive begins with ....

A) #

3. C allows arrays of greater than two dimensions, who will determine this?

B) compiler

4. The << operator is used for

B) Left shifting

5. Set of values of the same type, which have a single name followed by an index is called

C) array

6. Which of the following header file is required for strcpy() function?

A) String.h

7. scanf() can be used for reading ...

C) multiple characters

8. A variable which is visible only in the function in which it is defined is called

D) local variable

9. In the loop structure logical expression is checked at the ....................of the loop.

A) first

10. If an array is used as function argument, the array is passed

B) by reference

11. If is necessary to declare the type of function in the calling program if

B) Function returns a non-integer value

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

D) \n

13. Input/output function prototypes and macros are defined in which header file?

C) stdio.h

14. What is the purpose of fflush() function?

A) flushes all streams and specified streams

15. What does the following declaration mean?int(*ptr)[10].

B) ptr is a pointer to an array of 10 integers




Related Posts

 


Share this

Related Posts

Previous
Next Post »