Complicated Declarations

Q1: Point out the error in the following program (in Turbo C under DOS).
#include<stdio.h>

union emp
{
    int empno;
    int age;
};

int main()
{
    union emp e = {10, 25};
    printf('%d %d', e.empno, e.age);
    return 0;
}

A Error: Lvalue required

B Error: Rvalue required

C Error: cannot initialize more than one union member.

D No error

ANS:A - Error: Lvalue required

No answer description is available. Let's discuss.



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.