C Programming :: Basic Concepts - Discussion
Home > C Programming > Basic Concepts > MCQs Questions Discussion
7 / 90
What is the output of the following C Program?
#include<stdio.h>
void main()
{
char not;
not=!2;
printf("%d",not);
}
#include<stdio.h>
void main()
{
char not;
not=!2;
printf("%d",not);
}
A2
B0
C1
DCompilation error
ENone of these
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
Any non-zero value in C is considered as True, which means we can consider 2 as True.
So, !2 will mean False, which means 0 is assigned to not.
Hence, 0 is the output.
Read Full Answer
Report Error
Please Login First Click Here