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?
- robert frost
- Dennis Ritchie
- James A. Gosling
- E.F codd.
Ans. Dennis Ritchie
Q2. When was C language developed?
- 1978
- 1972
- 1973
- 1971
Ans. 1972
Q3. With the help of which C program is converted into machine language?
- With the help of editor
- With the help of compiler
- With the help of assembler
- none of the above
Ans. With the help of compiler
Q4 A c variable cannot begin with ………
- &
- by alphabet
- special symbol underscore
- none of these
Ans. &
Q5. Which of the following is used for arithmetic instruction of c?
- {}
- []
- ()
- none of these
Ans. ()
Q6. Dennis is the author of which programming book?
- c programming and technique
- thinking in c
- the c programming language
- learn c step by step
Ans. the c programming language
Q7. How many times does the following for loop run?
- 0 time
- infinite times
- 1 time
- 10 times
Ans- infinite times
Q8. Where was Denis Retchie born
- santna ana
- Bronxville, New York (USA)
- Dallas
- no one
Ans. Bronxville, New York (USA)
Q9. Which of the following operating systems is created by Dennis Retchie,
- ubuntu
- Linux
- UNIX
- Android
Ans. UNIX
Q10 what is string,
- group of characters
- set of special symbols
- both a or b
- none of the above
Ans. group of characters
Q11. Why use if else condition?
- To check a condition
- To check many conditions
- both a or b
- none of the above
Ans. to check a condition
Q12. Which loop is entry control loop?
- while loop
- for loop
- do loop
- nested loop
Ans. a & b
Q13. The syntax of which loop is (initial value; test condition; increment/ decrement),
- for loop
- while loop
- nested loop
- none of these
Ans. for loop
Q14. Which of the following cannot check switch case?
- character
- integer
- enum
- float
Ans. float
C Language MCQ:
Q15. Which statement is used to check any condition?
- if
- break
- continue
- exit
Ans. if
Q16. Which of the following is not a looping statement?
- for loop
- while
- do while
- switch
Ans. switch
Q17. for loop is…………..
- entry control loop
- Function control loop
- exit control loop
- none of the above
Ans. entry control loop
Q18. Which of the following is called the smallest element of the array?
- lower bound
- upper limit
- middle bound
- range
Ans. lower limit
Q19. How many types of array are there?
- 4
- 3
- 2
- none of the above
Ans. 3
Q20. of the following, which type of data type is array in C?
- derived data type
- custom data type
- primitive data type
- 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?
- char name [6] = {‘I’, ‘N’, ‘D’, ‘E’, ‘A’, ‘\0 ‘, }
- char name [6] = {“I”, “N”, “D”, “E”, “A”}
- char name [6] = {‘I’, ‘N’, ‘D’, ‘E’, ‘A’,}
- 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.
- value
- datatype
- variable name
- address
Ans. address
Q23. Which of the following signs is used to declare a pointer?
- %
- *
- &
- ^
Ans. *
Q24. There is a pointer……
- Variable that stores instructions
- Variable, which stores the address of another variable.
- is the keyword, which is used to create the variable.
- none of the above
Ans. Variable, which stores the address of another variable.
Q25. Which of the following operator “&” is of pointer,
- Conditional operator
- Address operator
- Logical operator
- none of these
Ans. Address operator
26:- What is sizeof in c?
- Operator
- Variable
- Function
- None of these
ans:- operator
27:- Graphical and diagrammatic presentation of an algorithm is called.
- er diagram
- Flow Chart
- These two
- None of these
ans:- flow chart
28:- c programming language is:-
- procedural
- Object Oriented
- None of these
Ans:- procedural
29:- What is it called, in which instructions are written step by step to solve a problem:-
- Algorithm
- Flow Chart
- Debugging
- Function
ans:- Algorithm
30:- Which of the following operators is used to compare the values of operands:-
- Logical operator
- Relational operator
- arithmetic operator
- bitwise operator
ans:- relational operator
C Language MCQ:
31:- Operator ‘&’ is used in-
- bitwise AND
- bitwise OR
- logical AND
- logical NOR
ans:- bitwise AND
32:- What is the size of character variable?
- 16 bytes
- 8 bytes
- 2 bytes
- 1 byte
ans:- 1 byte
33:- What is the maximum value of unsigned integer?
- 32767
- -32767
- 65535
- -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);
- 15 28 43
- 28 15 43
- 15 28 34
- 20 0 20
Ans:- 20 0 20
35:- break statement is used:-
- To quit the program
- Continue the program
- To go to the next iteration
- 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?
- switch
- break
- continue
- return
Ans:- return
37:- The maximum number of arguments in a function can be 20-
- yes
- no
ans:- No, the number of arguments in a function can be up to 127.
38:- Which header file uses malloc() and calloc() functions?
- conio.h
- stdio.hh
- stdlib.h
- math.h
Ans:- stdlib.h
39:- Which of the following is not a logical operator-
- &
- &&
- ||
- !
Ans:- &
40:- Which of the following is not checked in switch case statement-
- character
- integer
- float
- enum
ans:- float
41:- What is the storage size of Short data type?
- 4 bytes
- 2 bytes
- 6 bytes
- 8 bytes
Answer:- 2 bytes
42:- What is the storage size of long data type?
- 8 bytes
- 4 bytes
- 2 bytes
- none of these
Answer:- 4 bytes
43:- What is the storage size of double data type?
- 2 bytes
- 4 bytes
- 8 bytes
- 16 bytes
Answer:- 8 bytes
44:- What is the storage size of long double data type?
- 8 bytes
- 10 bytes
- 16 bytes
- 32 bytes
Answer:- 10 bytes
45:- What is the full name of STL?
- sample template library
- simple template library
- single type library
- single template library
Answer:- simple template library
46:- void is a data type?
- Truth
- false
Answer:- True
47:- The default value of automatic storage class is 0.
- Truth
- false
Answer:- False
48:- = and == have only one function.
- Truth
- false
Answer:- False
49:- What will be the output of the following program?
int y=30;
main()
{
int y=15;
printf(“%d”,y);
}
- 30
- 15
- Error
- 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?
- 32
- 40
- 45
- 56
Answer:- There are 32 keywords in C.
51:- Which of the following operators has the lowest priority?
- ==
- ++
- %
- &&
Answer:- &&
52:- What will be the output of the following program?
#include<stdio.h>
main()
{
int *y = 60;
printf(“%d”,*y);
}
- 60
- garbage value
- logical error
- 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?
- math.h
- dos.h
- stdio.h
- conio.h
Answer:- math.h
54:- The default method of passing parameters is;-
- call by reference
- call by value
- not either
Answer:- call by value
55. Which of the following true about FILE *fp
- FILE is a keyword in C for representing files and fp is a variable of FILE type.
- FILE is a stream
- FILE is a buffered stream
- 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
- character string containing the name of the file & the second argument is the mode
- A character string containing the name of the user & the second argument is the mode
- A character string containing file pointer & the second argument is the mode
- None of the mentioned
Ans. 1
57. FILE is of type ______
- int type
- char * type
- struct type
- None of the mentioned
Ans. 3
58. If there is any error while opening a file, fopen will return?
- Nothing
- EOF
- NULL
- Depends on compiler
Ans. 3
59. A data of the file is stored in?
- Ram
- Hard disk
- Rom
- None
Ans. 2
60. Select a function which is used to write a string to a file?
- pits()
- putc()
- fputs()
- fgets()
Ans. C
61. which Is data type of file pointer is?
- int
- double
- void
- FILE
Ans. 4
62. EOF is an integer type defined in stdio. hand has a value ____________
- 1
- 0
- NULL
- -1
Ans. 4
Some More:
POP- Introduction to Programming Using ‘C’
OOP – Object Oriented Programming
DBMS – Database Management System
RDBMS – Relational Database Management System
Join Now: Data Warehousing and Data Mining