C Fundamentals MCQs

303 questionsC-ProgramPage 18 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 154easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int a = 2;
    int b = 0;
    int y = (b == 0) ? a :(a > b) ? (b = 1): a;
    printf("%d\n", y);
}
Question 155easy
Which among the following is NOT a logical or relational operator?
Question 156easy
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    char a = '0';
    char b = 'm';
    int c = a && b || '1';
    printf("%d\n", c);
}
Advertisement
Question 157easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int x = 2, y = 2;
    int z = x ^ y & 1;
    printf("%d\n", z);
}
Question 158easy
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    double x = 123828749.66;
    int y = x;
    printf("%d\n", y);
    printf("%lf\n", y);
}
Question 159easy
What will be the final value of x in the following C code?
#include <stdio.h>
void main()
{
    int x = 5 * 9 / 3 + 9;
}
Advertisement
Question 160easy
What will be the output of the following C code?
#include<stdio.h>
enum Ram
{
    a=1,b
};
enum Shyam
{
    c,d
};
int main()
{
    enum Shyam s1=c;
    enum Shyam s=a;
    enum Ram s2=d;
    printf("%d",s);
    printf("%d",s1);
    printf("%d",s2);
}
Question 161easy
What is the type of the following assignment expression if x is of type float and y is of type int?
y = x + y;
Question 162easy
What will be the output of the following C code?
#include <stdio.h>
    int main()
    {
        printf("Hello World! %d \n", x);
        return 0;
    }