11.
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int x = 3, y = 2;
    int z = x /= y %= 2;
    printf("%d\n", z);
}

12.
What will be the output of the following C code considering the size of a short int is 2, char is 1 and int is 4 bytes?
#include <stdio.h>
int main()
{
    short int i = 20;
    char c = 97;
    printf("%d, %d, %d\n", sizeof(i), sizeof(c), sizeof(c + i));
    return 0;
}

16.
What will be the output of the following C code if input given is 2?
#include<stdio.h>
enum day
{
    a,b,c=5,d,e
};
main()
{
    printf("Enter the value for a");
    scanf("%d",a);
    printf("%d",a);
}

18.
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
}

Read More Section(C Fundamentals)

Each Section contains maximum 100 MCQs question on C Fundamentals. To get more questions visit other sections.