31. What is the correct way to define a macro in C?
a) macroName(parameter) { macroBody }
b) #define macroName(parameter) macroBody
c) #macro macroName(parameter) { macroBody }
d) macroName(parameter) { #macro macroBody }
32. What is the output of the following code snippet?
#include<stdio.h>
int main()
{
int x = 5;
int y = 3;
printf(“%d”, x += 3);
return 0;
}
a) 5
b) 3
c) 8
d) 15
33. What is the correct way to declare a string in C?
a) string str;
b) char* str;
c) char[] str;
d) char str[];
34. What is the output of the following code snippet?
#include<stdio.h>
int main()
{
int x = 5;
int y = 3;
printf(“%d”, x && y);
return 0;
}
a) 0
b) 1
c) 5
d) 3
35. What is the output of the following code snippet?
#include<stdio.h>
int main()
{
int x = 5;
int y = 3;
printf(“%d”, y % x);
return 0;
}
a) 3
b) 5
c) 8
d) 2