16. What is the correct way to declare a constant in C?
a) const constantName = value;
b) constantName = value;
c) constantName := value;
d) #define constantName value
17. What is the output of the following code snippet?
#include<stdio.h>
int main()
{
int x = 5;
int y = 3;
if (x > y)
{
printf(“x is greater”);
}
else
{
printf(“y is greater”);
}
return 0;
}
a) x is greater
b) y is greater
c) x and y are equal
d) None of the above
18. Which of the following is a correct way to declare an array in C?
a) int arr[5];
b) int arr[];
c) int arr{5};
d) int arr[5] = {};
19. 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
20. Which of the following is not a valid function in C standard library?
a) printf
b) scanf
c) main
d) pow