C Language - Structures,Unions
You Are Here :: Home > C Language > Structures,Unions General Questions
37. | What will be the output of the program ? #include
int main()
{
struct byte
{
int one:1;
};
struct byte var = {1};
printf("%d\n", var.one);
return 0;
}
|
|||||||
|
38. | Number of bytes in memory taken by the below structure is #include
struct test
{
int k;
char c;
};
|
|||||||
|
39. | What is the output of this C code(according to C99 standard)? #include
struct p
{
int k;
char c;
float f;
};
int main()
{
struct p x = {.c = 97};
printf("%f\n", x.f);
}
|
|||||||
|
40. | What is the output of this C code? #include
struct p
{
int k;
char c;
};
int p = 10;
int main()
{
struct p x;
x.k = 10;
printf("%d %d\n", x.k, p);
}
|
|||||||
|
41. | What is the output of this C code? #include
struct point
{
int x;
int y;
};
void foo(struct point*);
int main()
{
struct point p1[] = {1, 2, 3, 4};
foo(p1);
}
void foo(struct point p[])
{
printf("%d\n", p[1].x);
}
|
|||||||
|
42. | What is the output of this C code? #include
struct point
{
int x;
int y;
} p[] = {1, 2, 3, 4, 5};
void foo(struct point*);
int main()
{
foo(p);
}
void foo(struct point p[])
{
printf("%d %d\n", p->x, p[2].y);
}
|
|||||||
|
« previous
1
2
3
4
5
6
7
8
9
...next »