Home

C Programming MCQ - Multiple Choice Question and Answer

C Programming MCQ with detailed explanation for interview, entrance and competitive exams. Explanation are given for understanding.

Download Objective type questions of C Programming PDF

Visit our PDF store

Question No : 1
What would be the output of the following program?

int x=40;
main(){
int x=20;
printf("
%d",x);
}

40
20
Compilation Error
Garbeg Value

Question No : 2
What will be output if you will compile and execute the following c code?

#include 
int main(){
int i=320;
char *ptr=(char *)&i;
printf("%d",*ptr);
return 0;
}

1
64
320
Compiler Error

Question No : 3

What will be output if you will compile and execute the following c code?


#include 
#define x 5+2
int main(){
int i;
i=x*x*x;
printf("%d",i);
return 0;
}


27
343
233
Compiler Error

Question No : 4

What will be output if you will compile and execute the following c code?


#include 
int main(){
char c=125;
c=c+10;
printf("%d",c);
return 0;
}

 

135
+INF
-121
-135

Question No : 5
What will be output if you will compile and execute the following c code?

#include 
int main()
{
float a=5.2;
if(a==5.2)
printf("Equal");
else if(a<5.2)
printf("Less than");
else
printf("Greater than");
return 0;
}

Less than
Equal

Greater than

None of above

Question No : 6
For 16bit compiler allowable range for integer constants is ______ ?

3.4e38 to 3.4e38
32767 to 32768
32768 to 32767
32668 to 32667

Question No : 7
C programs are converted into machine language with the help of

An Editor
A compiler
An operating system
None of the above