Sail E0 Webinar
Question


What will be the output of the program?


#include<stdio.h>
#include<stdlib.h>
union employee
{
char name[15];
int age;
float salary;
};
const union employee e1;
int main()
{
strcpy(e1.name, "K");
printf("%s %d %f", e1.name, e1.age, e1.salary);
return 0;
}
Options:
A .  Error: RValue required
B .  Error: cannot CONVERT from 'const int *' to 'int *const'
C .  Error: LValue required in strcpy
D .  No error
Answer: Option D

The output will be (in 16-bit platform DOS):

K 75 0.000000



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

More Questions on This Topic :

Latest Videos

Latest Test Papers