Home Videos Exercises MCQ Q&A Quiz Services Sign in

C Programming MCQ

Soopro Pathshala provides CProgramming MCQ(Multiple Choice Questions)


1. Who is the father of C language?

a) Steve Jobs

b) James Gosling

c) Dennis Ritchie

d) Rasmus Lerdorf

View Answer

Answer: (c) Dennis Ritchie



2. All keywords in C are in ____________

a) LowerCase letters

b) UpperCase letters

c) CamelCase letters

d) None of the mentioned

View Answer

Answer: (a) LowerCase letters



3. What is an example of iteration in C?

a) for

b) while

c) do-while

d) all of the mentioned

View Answer

Answer: (d) all of the mentioned



4. What is the size of the int data type (in bytes) in C?

a) 4

b) 8

c) 2

d) 1

View Answer

Answer: (a) 1



5. How to declare a pointer-to-pointer in C?

a) int *val;

b) int **val;

c) int &val;

d) int *&val;

View Answer

Answer: (b) int **val;



6. Where scanf() function exist C?

a) stdio.h

b) stdlib.h

c) conio.h

d) none of the above

View Answer

Answer: (d) none of the above



7. What is the output of this statement "printf("%d", (a++))"?

a) The value of (a + 1)

b) The current value of a

c) Error message

d) Garbage

View Answer

Answer: (b) The current value of a



8. Why is a macro used in place of a function?

a) It reduces execution time.

b) It reduces code size.

c) It increases code size.

d) It increases code size.

View Answer

Answer: (b) It reduces code size



9. In the C language, the constant is defined _______

a) Before main

b) After main

c) Anywhere, but starting on a new line.

d) None of the these.

View Answer

Answer: (c) Anywhere, but starting on a new line.



10. Directives are translated by the

a) Pre-processor

b) Compiler

c) Linker

d) Editor

View Answer

Answer: (a) Pre-processor.



11. Which of the following statement is not true?

a) A pointer to an int and a pointer to a double are of the same size.

b) A pointer must point to a data item on the heap (free store).

c) A pointer can be reassigned to point to another data item.

d) A pointer can point to an array.

View Answer

Answer: (b) A pointer must point to a data item on the heap (free store).



12. Which of the following SLT template class is a container adaptor class?

a) Stack

b) List

c) Deque

d) Vector

View Answer

Answer: (a) Stack.



13. Array is a _________ data structure.

a) Non-linear

b) Primary

c) Linear

d) Data type

View Answer

Answer: (c) Linear



14. In which year was C language developed?

a) 1962

b) 1978

c) 1979

d) 1972

View Answer

Answer: (d) 1972



15. C language is a successor to which language?

a) Basic

b) Cobol

c) C++

d) B

View Answer

Answer: (d) B



16. C is a ___

a) Low level language

b) High level language

c) Medium level language

d) None of the above

View Answer

Answer: (c) Medium level language



17. How many keywords are there in C language?

a) 32

b) 33

c) 64

d) 18

View Answer

Answer: (a) 32



18. C language is a ___

a) Procedural oriented programming language

b) General purpose programming language

c) Structured programming

d) All of the above

View Answer

Answer: (d) All of the above



19. Which is not a valid keyword in C language?

a) for

b) while

c) do-while

d) switch

View Answer

Answer: (c) do-while



20. The C source file is processed by the ___.

a) Interpreter

b) Compiler

c) Both Interpreter and Compiler

d) Assembler

View Answer

Answer: (b) compiler



21. How many whitespace characters are allowed in C language?

a) 2

b) 3

c) 4

d) 5

View Answer

Answer: (d) 5



22. How many punctuation characters are allowed in C language?

a) 29

b) 30

c) 31

d) 32

View Answer

Answer: (a) 29



23. Which of the following is an important requirement of c programming?

a) Function

b) Input variables

c) Output variables

d) All of the above

View Answer

Answer: (a) Function



24. What are strings in C programming?

a) Individual variables

b) Group of function

c) Group of character type variables in array form

d) All of the above

View Answer

Answer: (c) Group of character type variables in array form



25. What does a do-while loop do?

a) Repeats the process infinitely

b) Processes the code at least once and then repeats

c) Repeats only once

d) All of the above

View Answer

Answer: (b) Processes the code at least once and then repeats



26. What is a while loop?

a) Repeats the loop if the condition applies true

b) Processes the code at least once and then repeats

c) Repeats only once

d) All of the above

View Answer

Answer: (a) Repeats the loop if the condition applies true



27. What of the following is true?

a) Variables are functions

b) Variable is a type of output command

c) Variables are used to store values

d) All of the above

View Answer

Answer: (c) Variables are used to store values



28. What are float variables?

a) Integer value

b) unknown value

c) Decimal value

d) All of the above

View Answer

Answer: (c) Decimal value



29. What is a function?

a) Looping code

b) Code that operates when called

c) Unknown variable

d) All of the above

View Answer

Answer: (b) Code that operates when called



30. To develop which operating, C language was invented?

a) Linux

b) Unix

c) Android

d) Mac

View Answer

Answer: (b) Unix



31. Which are the fundamental data types in C?

a) char

b) int

c) float

d) All of the above

View Answer

Answer: (d) All of the above



32. How many byte(s) does a char type take in C?

a) 1

b) 2

c) 3

d) 4

View Answer

Answer: (a) 1



33. For which type, the format specifier "%i" is used?

a) int

b) char

c) float

d) double

View Answer

Answer: (a) 1



34. What is the difference between float and double in C?

a) both are used for the same purpose

b) double can store just double value as compare to float value

c) double is an enhanced version of float and was introduced in C99

d) double is more precise than float and can store 64 bits

View Answer

Answer: (d) double is more precise than float and can store 64 bits



35. Which is the correct format specifier for double type value in C?

a) %d

b) %f

c) %lf

d) %LF

View Answer

Answer: (c) %lf



36. What is the correct syntax to declare a variable in C?

a) data_type variable_name;

b) data_type as variable_name;

c) variable_name data_type;

d) variable_name as data_type;

View Answer

Answer: (a) data_type variable_name;



37. How many types of qualifiers are there in C language?

a) 2

b) 3

c) 4

d) 5

View Answer

Answer: (b) 3



38. Which operator is used to find the remainder of two numbers in C?

a) /

b) \

c) %

d) //

View Answer

Answer: (c) %



39. Which of the following is not an arithmetic expression?

a) x=10

b) x/=10

c) x%=10

d) !=10

View Answer

Answer: (d) x!=10



40. scanf() is a predefined function in______header file.

a) stdlib.h

b) ctype.h

c) stdio.h

d) stdarg.h

View Answer

Answer: (c) stdio.h