Vidyalelo
C Programming · all questions

Operators and Expressions
practice.

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

85

Questions

4/5

Page

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

%f access specifier is used for . . . . . . . .

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
printf("%d", sizeof('a'));

Select an option to see the answer and solution.

Loss in precision occurs for typecasting from. . . . . . . .

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
union temp
{
    char a;
    char b;
    int c;
}t;
int main()
{
    printf("%d", sizeof(t));
    return 0;
}

Select an option to see the answer and solution.

Select the odd one out with respect to type?

Select an option to see the answer and solution.

Predict the data type of the following mathematical operation?
2 * 9 + 3 / 2 . 0

Select an option to see the answer and solution.

How many digits are present after the decimal in float value?

Select an option to see the answer and solution.

What is the size of float in a 32-bit compiler?

Select an option to see the answer and solution.

Which among the following is never possible as an output for a float?

Select an option to see the answer and solution.

Size of an array can be evaluated by . . . . . . . .
(Assuming array declaration int a[10];)

Select an option to see the answer and solution.

What type of value does sizeof return?

Select an option to see the answer and solution.

Which among the following is never possible in C when members are different in a structure and union?
//Let P be a structure
//Let Q be a union

Select an option to see the answer and solution.

What will be the size of the following C structure?
#include <stdio.h>
struct temp
{
    int a[10];
    char p;
};

Select an option to see the answer and solution.

What is the sizeof(void) in a 32-bit C?

Select an option to see the answer and solution.

Which of the following cannot be used inside sizeof?

Select an option to see the answer and solution.

Which data type is suitable for storing a number like?
10.0000000001

Select an option to see the answer and solution.

In a 32-bit compiler, which 2 types have the same size?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
printf("%d", sizeof(strlen("HELLOWORLD")));

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
printf("%.0f", 2.89);

Select an option to see the answer and solution.

What is the sizeof(char) in a 32-bit C compiler?

Select an option to see the answer and solution.