C Language Interview Questions Test 8
This Test will cover complete C with very important questions, starting off from basics to advanced level.
Q. Considering the below mentioned declarations. Which of the function invocation specified in options is valid?
char first(int (*) (char, float));
int second(char, float);
Q. For the below declaration. Which of the following is true?
int(*p)[5];
Q. A function q
that accepts a pointer to a character as argument and returns a pointer to an array of integer, can be declared as:
Q. What will be the output?
int a = 5, *b = &a;
printf("%d", a*b);
Q. If the machine in which this program is executed is little-endian
(meaning, the lower significant digits occupy lower addresses), then the output will be __________.
main()
{
int y = 1;
printf("%d", (*(char *)&x));
}
Q. a -> b
is syntactically correct if __________.
Q. For the following program fragment, choose the statements having errors.
char *a, *b, c[10], d[10];
a = b;
b = c;
c = d;
d = a;
Q. The operation of a staircase switch
best explains the?
Q. The code a << 1
is equivalent to __________.
Q. In a certain machine, the sum of an integer and it's 1 complement
is (2^20)-1
. Then the sizeof(int)
, in bits, will be?
Q. If the word size is 16
bit then ~0xc5
will be?
Q. The number of possible values of m
, such that m & 0x3f
equals 0x23
is?
Q. The code calloc(m, n);
is equivalent to?
Q. Consider the program fragment. If i >= 2
, then the value of j
, will be printed only if?
int j = 2; int i;
while((i%j) != 0)
{
j = j+1;
}
if(j < i)
{
printf("%d", j);
}
Considering the below macro. The macro-call hypotenuse(a+2, b+3);
__________.
#define hypotenuse(a,b) sqrt(a*a + b*b);