Vidyalelo
C Programming · all questions

C Fundamentals
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

303

Questions

7/16

Page

Pick an option on a question to see the right answer and solution.

enum types are processed by . . . . . . . .

Select an option to see the answer and solution.

Which of the following is not a valid C variable name?

Select an option to see the answer and solution.

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");
}

Select an option to see the answer and solution.

What will be the output of the following C code snippet?
#include <stdio.h>
void main()
{
    1 < 2 ? return 1: return 2;
}

Select an option to see the answer and solution.

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);
}

Select an option to see the answer and solution.

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);
}

Select an option to see the answer and solution.

When do you need to use type-conversions?

Select an option to see the answer and solution.

What is the result of logical or relational expression in C?

Select an option to see the answer and solution.

What is the precedence of arithmetic operators (from highest to lowest)?

Select an option to see the answer and solution.

The format identifier '%i' is also used for . . . . . . . . data type.

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 5;
    i = i / 3;
    printf("%d\n", i);
    return 0;
}

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int b = 5 + 7 * 4 - 9 * (3, 2);
    printf("%d", b);
}

Select an option to see the answer and solution.

What is short int in C programming?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int a = 10, b = 5, c = 3;
    b != !a;
    c = !!a;
    printf("%d\t%d", b, c);
}

Select an option to see the answer and solution.

Which of the following is not a valid variable name declaration?

Select an option to see the answer and solution.

What will be the final value of d in the following C code?
#include <stdio.h>
int main()
{
    int a = 10, b = 5, c = 5;
    int d;
    d = b + c == a;
    printf("%d", d);
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
 int main()
 {
     int i = -5;
     i = i / 3;
     printf("%d\n", i);
     return 0;
 }

Select an option to see the answer and solution.

Which of the following option is the correct representation of the following C statement?
e = a * b + c / d * f;

Select an option to see the answer and solution.

Point out the error( if any) in the following code.
#include<stdio.h>
enum India
{
    a,b,c
};
enum India g;
main()
{
    g++;
    printf("%d",g);
}

Select an option to see the answer and solution.