Control Instructions

Q1: Point out the error, if any in the program.
#include<stdio.h> 
int main()
{
    int a = 10, b;
    a >=5 ? b=100: b=200;
    printf('%d\n', b);
    return 0;
}

A 100

B 200

C Error: L value required for b

D Garbage value

ANS:A - 100

Variable b is not assigned. It should be like:

b = a >= 5 ? 100 : 200;



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.