C Interview Questions 2


Questions by Rejinpaul.com


1. #include
int main()
{
int a=0;
#if (a==0)
printf("Equal");
#else if
printf("Not equal");
#endif
return 0;
}
a)Equal
b)Null
c)Garbage
d)Compilation error


◊ View answer     ◊ Share This In FB _____________________________________________________________________________________________________________________


2. #include
int main()
{
for(;NULL;)
printf("cquestionbank");
return 0;
}
a)c
b) bank
c) cquestionbank
d) Infinite loop


◊ View answer     ◊ Share This In FB _____________________________________________________________________________________________________________________


3. #include
int main()
{
int x=25;
if(!!x)
printf("%d",!x);
else
printf("%d",x);
return 0;
}
a) 0
b) 25
c)1
d)-1


◊ View answer     ◊ Share This In FB _____________________________________________________________________________________________________________________


4. #include
int main()
{
float a=0.5, b=0.9;
if(a&&b>0.9)
printf("Sachin");
else
printf("Rahul");
return 0;
}
a)Sachin
b)Rahul
c)null
d)Run time error


◊ View answer     ◊ Share This In FB _____________________________________________________________________________________________________________________


5. #include
int main()
{
int x=5, y=10;
if(!(!x) && x)
printf("%d",x);
else
printf("%d",y);
return 0 ;
}
a)1
b)0
c)Compilation error
d)5


◊ View answer     ◊ Share This In FB _____________________________________________________________________________________________________________________

Pages:

1 2 3 4

Ad Inside Post

Comments system

Disqus Shortname