C Fundamentals MCQs

303 questionsC-ProgramPage 19 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 163easy
What will be the final value of c in the following C statement? (Initial value: c = 2)
c <<= 1;
Question 164easy
Consider this statement: typedef enum good {a, b, c} hello; Which of the following statements is incorrect about hello?
Question 165easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int ThisIsVariableName = 12;
    int ThisIsVariablename = 14;
    printf("%d", ThisIsVariablename);
    return 0;
}
Advertisement
Question 166easy
What will be the output of the following C code?
#include<stdio.h>
int main()
{
    typedef union a
    {
        int i;
        char ch[2];
    }hello;
    hello u;
    u.ch[0] = 3;
    u.ch[1] = 2;
    printf("%d, %d", u.ch[0], u.ch[1]);
    return 0;
}
Question 167easy
Which of the following operator has the highest precedence in the following?
Question 168easy
Which function in the following expression will be called first?
a = func3(6) - func2(4, 5) / func1(1, 2, 3);
Advertisement
Question 169easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int x = 1;
    short int i = 2;
    float f = 3;
    if (sizeof((x == 2) ? f : i) == sizeof(float))
        printf("float\n");
    else if (sizeof((x == 2) ? f : i) == sizeof(short int))
        printf("short int\n");
}
Question 170easy
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int h = 8;
    int b = h++ + h++ + h++;
    printf("%d\n", h);
}
Question 171easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    enum {ORANGE = 5, MANGO, BANANA = 4, PEACH};
    printf("PEACH = %d\n", PEACH);
}