In this article C Language MCQ we give the information about important MCQ on C Programming with there answer with explanation.

C Language MCQ:

Q1. Who discovered c language?

  1. robert frost
  2. Dennis Ritchie
  3. James A. Gosling
  4. E.F codd.

Ans. Dennis Ritchie

Q2. When was C language developed?

  1. 1978
  2. 1972
  3. 1973
  4. 1971

Ans. 1972

Q3. With the help of which C program is converted into machine language?

  1. With the help of editor
  2. With the help of compiler
  3. With the help of assembler
  4. none of the above

Ans. With the help of compiler

Q4 A c variable cannot begin with ………

  1. &
  2. by alphabet
  3. special symbol underscore
  4. none of these

Ans. &

Q5. Which of the following is used for arithmetic instruction of c?

  1. {}
  2. []
  3. ()
  4. none of these

Ans. ()

Q6. Dennis is the author of which programming book?

  1. c programming and technique
  2. thinking in c
  3. the c programming language
  4. learn c step by step

Ans. the c programming language

Q7. How many times does the following for loop run?

  1. 0 time
  2. infinite times
  3. 1 time
  4. 10 times

Ans- infinite times

Q8. Where was Denis Retchie born

  1. santna ana
  2. Bronxville, New York (USA)
  3. Dallas
  4. no one

Ans. Bronxville, New York (USA)

Q9. Which of the following operating systems is created by Dennis Retchie,

  1. ubuntu
  2. Linux
  3. UNIX
  4. Android

Ans. UNIX

Q10 what is string,

  1. group of characters
  2. set of special symbols
  3. both a or b
  4. none of the above

Ans. group of characters

Q11. Why use if else condition?

  1. To check a condition
  2. To check many conditions
  3. both a or b
  4. none of the above

Ans. to check a condition

Q12. Which loop is entry control loop?

  1. while loop
  2. for loop
  3. do loop
  4. nested loop

Ans. a & b

Q13. The syntax of which loop is (initial value; test condition; increment/ decrement),

  1. for loop
  2. while loop
  3. nested loop
  4. none of these

Ans. for loop

Q14. Which of the following cannot check switch case?

  1. character
  2. integer
  3. enum
  4. float

Ans. float

C Language MCQ:

Q15. Which statement is used to check any condition?

  1. if
  2. break
  3. continue
  4. exit

Ans. if

Q16. Which of the following is not a looping statement?

  1. for loop
  2. while
  3. do while
  4. switch

Ans. switch

Q17. for loop is…………..

  1. entry control loop
  2. Function control loop
  3. exit control loop
  4. none of the above

Ans. entry control loop

Q18. Which of the following is called the smallest element of the array?

  1. lower bound
  2. upper limit
  3. middle bound
  4. range

Ans. lower limit

Q19. How many types of array are there?

  1. 4
  2. 3
  3. 2
  4. none of the above

Ans. 3

Q20. of the following, which type of data type is array in C?

  1. derived data type
  2. custom data type
  3. primitive data type
  4. none of these

Ans. derived data type

Q21. If the character INDEA is to be stored in C, then what will be the syntax of the following?

  1. char name [6] = {‘I’, ‘N’, ‘D’, ‘E’, ‘A’, ‘\0 ‘, }
  2. char name [6] = {“I”, “N”, “D”, “E”, “A”}
  3. char name [6] = {‘I’, ‘N’, ‘D’, ‘E’, ‘A’,}
  4. char name [ ]; = “India”

Ans. char name [6] = {‘I’, ‘N’, ‘D’, ‘E’, ‘A’, ‘\0 ‘, }

Q22. Pointer is a special type of variable, which is used to store ……….. of the variable.

  1. value
  2. datatype
  3. variable name
  4. address

Ans. address

Q23. Which of the following signs is used to declare a pointer?

  1. %
  2. *
  3. &
  4. ^

Ans. *

Q24. There is a pointer……

  1. Variable that stores instructions
  2. Variable, which stores the address of another variable.
  3. is the keyword, which is used to create the variable.
  4. none of the above

Ans. Variable, which stores the address of another variable.

Q25. Which of the following operator “&” is of pointer,

  1. Conditional operator
  2. Address operator
  3. Logical operator
  4. none of these

Ans. Address operator

26:- What is sizeof in c?

  1. Operator
  2. Variable
  3. Function
  4. None of these

ans:- operator

27:- Graphical and diagrammatic presentation of an algorithm is called.

  1. er diagram
  2. Flow Chart
  3. These two
  4. None of these

ans:- flow chart

28:- c programming language is:-

  1. procedural
  2. Object Oriented
  3. None of these

Ans:- procedural

29:- What is it called, in which instructions are written step by step to solve a problem:-

  1. Algorithm
  2. Flow Chart
  3. Debugging
  4. Function

ans:- Algorithm

30:- Which of the following operators is used to compare the values ​​of operands:-

  1. Logical operator
  2. Relational operator
  3. arithmetic operator
  4. bitwise operator

ans:- relational operator

C Language MCQ:

31:- Operator ‘&’ is used in-

  1. bitwise AND
  2. bitwise OR
  3. logical AND
  4. logical NOR

ans:- bitwise AND

32:- What is the size of character variable?

  1. 16 bytes
  2. 8 bytes
  3. 2 bytes
  4. 1 byte

ans:- 1 byte

33:- What is the maximum value of unsigned integer?

  1. 32767
  2. -32767
  3. 65535
  4. -65535

ans:- 65535

34:- What will be the output of the following program-

int a=40, b=20, c=100;

c=a-b;

b=c-b;

a=c-b;

printf(“\n%d%d%d”,a,b,c);

  1. 15 28 43
  2. 28 15 43
  3. 15 28 34
  4. 20 0 20

Ans:- 20 0 20

35:- break statement is used:-

  1. To quit the program
  2. Continue the program
  3. To go to the next iteration
  4. Quit the current iteration

ans:- To quit the current iteration

36:- Which keyword is used to transfer control from a function to the calling function?

  1. switch
  2. break
  3. continue
  4. return

Ans:- return

37:- The maximum number of arguments in a function can be 20-

  1. yes
  2. no

ans:- No, the number of arguments in a function can be up to 127.

38:- Which header file uses malloc() and calloc() functions?

  1. conio.h
  2. stdio.hh
  3. stdlib.h
  4. math.h

Ans:- stdlib.h

39:- Which of the following is not a logical operator-

  1. &
  2. &&
  3. ||
  4. !

Ans:- &

40:- Which of the following is not checked in switch case statement-

  1. character
  2. integer
  3. float
  4. enum

ans:- float

41:- What is the storage size of Short data type?

  1. 4 bytes
  2. 2 bytes
  3. 6 bytes
  4. 8 bytes

Answer:- 2 bytes

42:- What is the storage size of long data type?

  1. 8 bytes
  2. 4 bytes
  3. 2 bytes
  4. none of these

Answer:- 4 bytes

43:- What is the storage size of double data type?

  1. 2 bytes
  2. 4 bytes
  3. 8 bytes
  4. 16 bytes

Answer:- 8 bytes

44:- What is the storage size of long double data type?

  1. 8 bytes
  2. 10 bytes
  3. 16 bytes
  4. 32 bytes

Answer:- 10 bytes

45:- What is the full name of STL?

  1. sample template library
  2. simple template library
  3. single type library
  4. single template library

Answer:- simple template library

46:- void is a data type?

  1. Truth
  2. false

Answer:- True

47:- The default value of automatic storage class is 0.

  1. Truth
  2. false

Answer:- False

48:- = and == have only one function.

  1. Truth
  2. false

Answer:- False

49:- What will be the output of the following program?

int y=30;

main()

{

int y=15;

printf(“%d”,y);

}

  1. 30
  2. 15
  3. Error
  4. None of these.

Answer:- 15, because whenever there is a conflict between a global variable and a local variable, then the local variable is given priority.

C Language MCQ:

50:- How many keywords are there in C language?

  1. 32
  2. 40
  3. 45
  4. 56

Answer:- There are 32 keywords in C.

51:- Which of the following operators has the lowest priority?

  1. ==
  2. ++
  3. %
  4. &&

Answer:- &&

52:- What will be the output of the following program?

#include<stdio.h>

main()

{

int *y = 60;

printf(“%d”,*y);

}

  1. 60
  2. garbage value
  3. logical error
  4. run time error

Answer:- Run time error will occur because the pointer variable does not contain the correct address.

53:- In C language, which header file is used to perform mathematical operations?

  1. math.h
  2. dos.h
  3. stdio.h
  4. conio.h

Answer:- math.h

54:- The default method of passing parameters is;-

  1. call by reference
  2. call by value
  3. not either

Answer:- call by value

55. Which of the following true about FILE *fp

  1. FILE is a keyword in C for representing files and fp is a variable of FILE type.
  2. FILE is a stream
  3. FILE is a buffered stream
  4. FILE is a structure and fp is a pointer to the structure of FILE type

Ans. 4

56. The first and second arguments of fopen() are

  1. character string containing the name of the file & the second argument is the mode
  2. A character string containing the name of the user & the second argument is the mode
  3. A character string containing file pointer & the second argument is the mode
  4. None of the mentioned

Ans. 1

57. FILE is of type ______

  1. int type
  2. char * type
  3. struct type
  4. None of the mentioned

Ans. 3

58. If there is any error while opening a file, fopen will return?

  1. Nothing
  2. EOF
  3. NULL
  4. Depends on compiler

Ans. 3

59. A data of the file is stored in?

  1. Ram
  2. Hard disk
  3. Rom
  4. None

Ans. 2

60. Select a function which is used to write a string to a file?

  1. pits()
  2. putc()
  3. fputs()
  4. fgets()

Ans. C

61. which Is data type of file pointer is?

  1. int
  2. double
  3. void
  4. FILE

Ans. 4

62. EOF is an integer type defined in stdio. hand has a value ____________

  1. 1
  2. 0
  3. NULL
  4. -1

Ans. 4

Some More: 

POP- Introduction to Programming Using ‘C’

DS – Data structure Using C

OOP – Object Oriented Programming 

Java Programming

DBMS – Database Management System

RDBMS – Relational Database Management System

Join Now: Data Warehousing and Data Mining 

Leave a Reply

Your email address will not be published. Required fields are marked *