C Language Interview Questions Test 13

This Test will cover complete C with very important questions, starting off from basics to advanced level.

Q. The purpose of the following program fragment, where s and b are two integers is to __________?
b = s + b;
s = b - s;
b = b - s;
Q. Consider the function, if a and b be two non-negative integers, then the call find(a, find(a,b)) can be used to find __________?
find(int x, int y)
{
    return((x < y) ? 0 : (x - y));
}
Q. In the above code, let a and b be two non-negative integers. Which of the following calls finds the positive difference of a and b?
Q. If an integer needs two bytes of storage then maximum value of a signed integer is?

Q. Consider the below statements, if a is the first input and b is the second input, the output will be?
putchar(getchar());
putchar(getchar());
Q. If y is of integer type then the below expressions __________?
3*(y-8) / 9 and (y-8) / 9*3
Q. The following code fragment __________.
int x, y = 2, z, a;
x = (y*=2) + (z=a=y);
printf("%d", x);
Q. The code printf("%c", 100); __________.
Q. The following program fragment, results in the printing of?
if(a == 7)
    printf("a is seven");
else
	printf("a is not seven");

Q. The following program fragment __________.
int a = 4, b = 6;
printf("%d", a == b);
Q. The following program results in __________?
main()
{
    int i = 5;
	if(i == 5) 
	    return;
	else 
	    printf("i is not five");
    // printf over
	printf("over");
}
Q. The following statements will result in the printing of?
for(i = 3; i < 15; i+=3)
{ 
    printf("%d", i);
	++i;
}
Q. If a = 9, b = 5 and c = 3, then the expression (a - a/b * b%c) > a%b%c evaluates to?
Q. In the following program fragment, s2 will be executed if?
if(a > b)
    if(b > c)
        s1;
	else 
        s2;
Q. In the following program fragment, a <= b will be printed if?
if(a > b)
    printf("a > b");
else
    printf("else part");
printf("a <= b");

SUBMIT TEST