ExamVeda
Login
Home
11
What will be the output of the following C code?
#include <stdio.h>
union p
{
    int x;
    char y;
};
int main()
{
    union p p, b;
    p.y = 60;
    b.x = 12;
    printf("%d\n", p.y);
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
12
What will be the output of the following C code?
#include <stdio.h>
struct p
{
    int k;
    char c;
    float f;
};
int p = 10;
int main()
{
    struct p x = {1, 97};
    printf("%f %d\n", x.f, p);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
13
Which of the following structure declaration will throw an error?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
14
What will be the output of the following C code?
#include <stdio.h>
union u
{
    struct
    {
        unsigned char x : 2;
        unsigned int y : 2;
    }p;
    int x;
};
int main()
{
    union u u;
    u.p.x = 2;
    printf("%d\n", u.p.x);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
15
What will be the output of the following C code?
#include <stdio.h>
struct student
{
    int no;
    char name[20];
}
void main()
{
    struct student s;
    s.no = 8;
    printf("hello");
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
16
Which of the following is false about typedef?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
17
Which function is responsible for recording the name "s" and the replacement text "t" in a table?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
18
The number of distinct nodes the following struct declaration can point to is . . . . . . . .
struct node
{
    struct node *left;
    struct node *centre;
    struct node *right;
};
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
19
In the following declaration of bit-fields, the constant-expression specifies . . . . . . . .
struct-declarator:
declarator
type-specifier declarator opt : constant-expression
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
20
What will be the output of the following C code?
#include <stdio.h>
struct student
{
    char *c;
};
void main()
{
    struct student s[2];
    printf("%d", sizeof(s));
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board