C Language - Structures,Unions
You Are Here :: Home > C Language > Structures,Unions General Questions
31. | What will be the output of the program ? #include
struct course
{
int courseno;
char coursename[25];
};
int main()
{
struct course c[] = { {102, "Java"},
{103, "PHP"},
{104, "DotNet"} };
printf("%d ", c[1].courseno);
printf("%s\n", (*(c+2)).coursename);
return 0;
}
|
|||||||
|
32. | What would be the size of the following union declaration? #include
union uTemp
{
double a;
int b[10];
char c;
}u;
(Assuming size of double = 8, size of int = 4, size of char = 1)
|
|||||||
|
33. | What will be the output of the program given below in 16-bit platform ? #include
int main()
{
enum value{VAL1=0, VAL2, VAL3, VAL4, VAL5} var;
printf("%d\n", sizeof(var));
return 0;
}
|
|||||||
|
34. | What type of data is holded by variable u int this C code? #include
union u_tag
{
int ival;
float fval;
char *sval;
} u;
The variable u here
|
|||||||
|
35. | What will be the output of the program ? #include
int main()
{
enum status {pass, fail, absent};
enum status stud1, stud2, stud3;
stud1 = pass;
stud2 = absent;
stud3 = fail;
printf("%d %d %d\n", stud1, stud2, stud3);
return 0;
}
|
|||||||
|
36. | What is the output of this C code? #include
struct
{
char *name;
union
{
char *sval;
} u;
} symtab[10];
the first character of the string sval by either of
|
|||||||
|
« previous
1
2
3
4
5
6
7
8
9
...next »