Programming MCQs

MCQ on C Programming With Answers set-4

Pinterest LinkedIn Tumblr
This set of MCQ on C programming includes the collection of multiple-choice questions on the fundamentals of C programming language with answers. It includes MCQ on the C preprocessor directive, operators, and arrays on C and function declaration in C programming language with their answers.

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

Read Also: Objective type Questions in C Programming Language

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, a logical expression is checked at the ………………..of the loop.
A) first
B) end
C) middle
D) second

10. If an array is used as a function argument, the array is passed
A) by value
B) by reference
C) by name
D) the array cannot be used as a function argument

11. It is necessary to declare the type of function in the calling program if
A) The function returns an integer
B) Function returns a non-integer value
C) The function is not defined in the same file
D) The function is called a 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 the 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 an 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 a pointer to an 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, the logical expression is checked at the ………………..of the loop.
A) first

10. If an array is used as a function argument, the array is passed
B) by reference

11. It 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

Read Next: Solved MCQ on C Programming Language set-5

Author

Shuseel Baral is a web programmer and the founder of InfoTechSite has over 8 years of experience in software development, internet, SEO, blogging and marketing digital products and services is passionate about exceeding your expectations.

Comments are closed.