17th
Mar
C Programming MCQ

C Programming MCQ

  • Admin
  • 17th Mar, 2023
  • 377 Followers

C is a structured-oriented programming language and is used to write various applications. It was developed by Dennis Ritchie at Bell laboratories in 1972. C is considered one of the most popular programming languages as it is simple, flexible, and powerful. It has both low-level and high-level features that allow programmers to achieve complex tasks in a quicker manner.

Finally, Practice C Programming Multiple Choice Questions to test your final preparation for your exams or interviews.

C Programming MCQ Online Test

1) Can we declare function inside structure of c programming?

  • A. Yes
  • B.No

2) Which of the following cannot be a structure member?

  • A. Array
  • B.Function
  • C.Another structure
  • D.None of the Above

3) ............. is the father of C language

  • A. James Gosling
  • B.Dennis Ritchie
  • C.Rasmus Lerdorf
  • D.None of the Above

4) Which of the following is not a valid variable name in C Programming?

  • A. float rate;
  • B.int $main;
  • C.int number;
  • D.None of the Above

5) Which of the following declaration is not supported by C language?

  • A. char *str;
  • B.float str = 3e2;
  • C.String str;
  • D.None of the Above
Download Free : C Programming MCQ PDF

6) ............... keyword is used to prevent any changes in the variable within a C program.

  • A. const
  • B.volatile
  • C.mutable
  • D.immutable

7) What is the output of the following C code?

  • A. Conaxweb.com is printed infinite times
  • B.No Output
  • C.Conaxweb.com
  • D.Error because function name cannot be preceded by const

8) What is the output of the following C function?

  • A. Compilation error
  • B.1 2 3 4 5
  • C.Segmentation fault
  • D.None of the Above

9) scanf() is a predefined function in stdio. h header file.

  • A. True
  • B.False

10) The C-preprocessors are specified with ...............

  • A. ” ”
  • B.&
  • C.$
  • D.#

11) What is the output of following C Code?

  • A. Infinite loop
  • B.In while loop 3
  • C.In while loop 2
  • D.In while loop in while loop 3

12) Which of the following is an array initialized in C language?

  • A. int a = {1, 2, 3};
  • B.int a[3] = {1, 2, 3};
  • C.int a[ ] = new int [3]
  • D.None of the Above

13) What is the return type of the fopen() function in C?

  • A. An integer
  • B.Pointer to an integer
  • C.Pointer to a FILE Object
  • D.None of the above

14) How to find the length of an array in C?

  • A. sizeof(a)
  • B.sizeof(a[0])
  • C.sizeof(a) * sizeof(a[0])
  • D.sizeof(a) / sizeof(a[0])

15) What will be the output of the following code snippet?

  • A. 4
  • B.8
  • C.12
  • D.16

16) Directives are translated by the ....................

  • A. Linker
  • B.Editor
  • C.Compiler
  • D.Pre-processor

17) ........... can be used with vectors.

  • A. Forward iterator
  • B.Random access iterator
  • C.Bi-directional iterator
  • D.All of the Above

18) Which of the following is valid expression in c language?

  • A. int my num = 1000;
  • B.int my num == 10000;
  • C.int my_num = 100,000;
  • D.int my_num = 100000;

19) Which of the following is the first operating system designed using C programming language?

  • A. Mac
  • B.DOS
  • C.Windows
  • D.Unix

20) Which of the following is not a correct variable type?

  • A. float
  • B.int
  • C.real
  • D.double

21) Select the wrong option about structs in C.

  • A. No data hinding
  • B.Constructors are not allowed inside structs.
  • C.Functions are not allowed inside structs.
  • D.None of the above

22) Which of the following data structure is used to handle recursion in C?

  • A. Trees
  • B.Stack
  • C.Deque
  • D.Queue

23) .................. is not a storage class specifier in C?

  • A. static
  • B.extern
  • C.volatile
  • D.None of the above

24) Function overloading is not possible in which programming language?

  • A. C
  • B.Java
  • C.Python
  • D.C#

25) Choose the correct syntax for double pointer in C?

  • A. int **val
  • B.int *val
  • C.int *&val
  • D.None of the above

26) Select the proper syntax for declaring macros in C.

  • A. #define II
  • B.#define long long
  • C.#define II long long
  • D.None of the above

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

01st
Mar
PHP MCQ
01st
Jun
Azure MCQ
01st
Feb
WCF MCQ
01st
Feb
iOS MCQ
01st
Jun
Kubernetes MCQ