C Fundamentals MCQs

303 questionsC-ProgramPage 14 of 34

Practice free C Fundamentals 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 303 questions — no login required.

Question 118easy
What will be the final values of i and j in the following C code?
#include <stdio.h>
int x = 0;
int f()
{
    if (x == 0)
        return x + 1;
    else
        return x - 1;
}
int g()
{
    return x++;
}
int main()
{
    int i = (f() + g()) | g(); //bitwise or
    int j = g() | (f() + g()); //bitwise or
}
Question 119easy
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int b = 5 & 4 & 6;
    printf("%d", b);
}
Question 120easy
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    double b = 5 & 3 && 4 || 5 | 6;
    printf("%lf", b);
}
Advertisement
Question 121easy
enum types are processed by . . . . . . . .
Question 122easy
Which of the following is not a valid C variable name?
Question 123easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int a = 10;
    if (a == a--)
        printf("TRUE 1\t");
    a = 10;
    if (a == --a)
        printf("TRUE 2\t");
}
Advertisement
Question 124easy
What will be the output of the following C code snippet?
#include <stdio.h>
void main()
{
    1 < 2 ? return 1: return 2;
}
Question 125easy
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int k = 8;
    int m = 7;
    int z = k < m ? k = m : m++;
    printf("%d", z);
}
Question 126easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int x = 3, y = 2;
    int z = x << 1 > 5;
    printf("%d\n", z);
}