C output type question
Q. What would be the output of the following program? (C programming)
#include”stdio.h”
main()
{
int a, b=5;
a=b+NULL;
printf(“%d”, a);
}- Published on 25 Jun 15a. 6
b. 5
c. 5 5
d. None
ANSWER: 5
The value for b=5
a=b+null (null value is always 0)
a=5+0
a=5
Hence, the output is 5.