C Miscellaneous MCQs
Practice free C Miscellaneous multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 70 questions — no login required.
Question 46hard
What will be the output of the following C code?
#include<stdio.h>
main()
{
int n;
n=f1(4);
printf("%d",n);
}
f1(int x)
{
int b;
if(x==1)
return 1;
else
b=x*f1(x-1);
return b;
}Question 47medium
In the absence of a exit condition in a recursive function, the following error is given . . . . . . . .
Question 48easy
What is the output of this C code?
#include <stdio.h>
main()
{
if (sizeof(int) > -1)
printf("True");
else
printf("False");
}Advertisement
Question 49medium
What will be the value of the following assignment expression?
(x = foo())!= 1 considering foo() returns 2Question 50hard
Suppose we have: int a=100; (signed by default).If we want to convert this to an unsigned long integer, we can do this by making the following small change:
Question 51medium
Suppose we transfer a file written on a little endian machine to a big endian machine and there is no transformation from little endian to big endian, then what happens?
Advertisement
Question 52easy
File formats which have . . . . . . . . as a basic unit are independent of endianness.
Question 53hard
What will be the output of the following C code?
#include<stdio.h>
static inline int max(int a, int b)
{
return a > b ? a : b;
}
main()
{
int m;
m=max(-6,-5);
printf("%d",m);
}Question 54medium
Sign qualifiers can be applied to double.