C Miscellaneous - Study Mode

[#81] If the code shown below is executed on a little endian machine, then what will be the output of the following C code? #include<stdio.h>
main()
{
int y=1
printf("%d", (*(char*)&y))
}
Correct Answer

(A) 1

[#82] If the output of the following C code is "Big endian", then what will be the value of *a is? #include <stdio.h>
int main()
{
unsigned int i = 1
char *a = (char*)&i
if (*a)
printf("Little endian")
else
printf("Big endian")
getchar()
return 0
}
Correct Answer

(B) 0

[#83] What will be the output of the following C code? #include<stdio.h>
main()
{
int n,i
n=f(6)
printf("%d",n)
}
f(int x)
{
if(x==2)
return 2
else
{
printf("+")
f(x-1)
}
}
Correct Answer

(A) ++++2

[#84] What will be the output of the following C code? #include<stdio.h>
#define inline
inline f(char a)
{
#ifdef inline
printf("%c",a)
#endif
}
main()
{
f('a')
}
Correct Answer

(B) a

[#85] Comment on the following C statement. n = 1
printf("%d, %dn", 3*n, n++)
Correct Answer

(D) Output is compiler dependent