C Language - Structures,Unions
You Are Here :: Home > C Language > Structures,Unions General Questions
19. | #include |
|||||||
|
20. | enum colors {BLACK,BLUE,GREEN} main()
{
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
}
|
|||||||
|
21. | #include |
|||||||
|
22. | What will be output if you will execute following code? #include
union address{
char *name;
char street[10];
int pin;
};
int main(){
union address emp,*p;
emp.name="sh\0alu";
p=&emp;
printf("%s%s",p->name,(*p).name);
return 0;
}
|
|||||||
|
23. | What will be output if you will execute following code? #include
struct address{
char *name;
char street[10];
int pin;
}ex={"G.shalini","A-1",456003},*p=&ex;
int main(){
printf("%s%s",p->name,(*p).street);
return 0;
}
|
|||||||
|
24. | What is the output of this C code? #include
union utemp
{
int a;
double b;
char c;
}u;
int main()
{
u.c = 'A';
u.a = 1;
printf("%d", sizeof(u));
}
The output will be: (Assuming size of char = 1, int = 4, double = 8)
|
|||||||
|
« previous
1
2
3
4
5
6
7
8
9
...next »