C language MCQs

 1) C was invented to write an operating system called ___________.

A) Windows B) macOS C)Android D) UNIX

Correct Ans: UNIX


2) C program consists the following parts- 

A)Preprocessor Commands B) Functions C)Variables D) All of these

Correct Ans:All of These


3) Keyword, an identifier, a constant, a string literal, or a symbol are known as _________.

A) data types B) tokens C) variable D) fuction

Correct Ans:tokens


4) The type ___________ indicates that no value is available.

A)int B) void C) float D) long

Correct Ans:void


5) A __________ is nothing but a name given to a storage area which helps programs to perform operations.

A)identifier B) data type C) variable D) function

Correct Ans: variable


6) ____________ are treated as regular variables except that their values cannot be modified after their definition.

A)data types B) array C) literals D) Constants 

Correct Ans:Constants 


7) The ________ storage class is the default storage class for all local variables.

A)auto B)register C) static D) extern

Correct Ans:auto


8) ______________ is Called Logical AND operator.

A) $ B)! C) && D) ||

Correct Ans: &&


9) ___________ Operator copies a bit if it exists in either operand.

A) | B) & C) ^ D) ~

Correct Ans: |


10) ____________ statement allows a variable to be tested for equality against a list of values.

A) switch B) if C) if...else D) nested switch

Correct Ans:switch


11) ___________ Terminates the loop or switch statement and transfers execution to the statement immediately following the loop or switch.

A)break B) pass C) continue D) goto

Correct Ans:break


12) A function ___________ tells the compiler about a function's name, return type, and parameters.

A) operator B) defination C) declaration D) return type

Correct Ans: declaration


13) A _____________ variable is available for use throughout your entire program after its declaration.

A) formal B) instant C) local D)global 

Correct Ans:global


14) The _________ must be an integer constant greater than zero and type can be any valid C data type. 

A) arraySize B) stacksize C) data structure D) variable size  

Correct Ans: arraySize


15) Dynamic memory allocation, cannot be performed without using ________.

A)array B) stack C) pointers D) variable

Correct Ans:pointers


16) ___________ returns the length of string. 

A) strlen(s1); B) strcat(s1, s2); C) strcpy(s1, s2); D) strcmp(s1, s2);

Correct Ans: strlen(s1);


17) In C language, _____________ are used to represent a record.

A) union B) Structures  C) array D) pointer

Correct Ans: Structures 


18) A ___________ is a data type which allows to store different data types in same memory location. 

A)union  B) Structures  C) array D) pointer

Correct Ans: union 


19) To perform file operations in C ________ use to opens a text file for both reading and writing.

A)r B) r+  C) w+ D) a+

Correct Ans: r+


20) In C language, all ____________ commands begin with a hash symbol (#).

A) execution B) interpreter  C) preprocessor D) compiler

Correct Ans: preprocessor

Comments