ExamVeda
Login
Home
41
User-defined data type can be derived by . . . . . . . .
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
42
What will be the output of the following C code?
#include <stdio.h>
struct student
{
    int no;
    char name[20];
};
void main()
{
    student s;
    s.no = 8;
    printf("hello");
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
43
Which of the following are themselves a collection of different data types?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
44
What will be the output of the following C code?
#include <stdio.h>
struct point
{
    int x;
    int y;
};
void foo(struct point*);
int main()
{
    struct point p1[] = {1, 2, 3, 4, 5};
    foo(p1);
}
void foo(struct point p[])
{
    printf("%d %d\n", p->x, (p + 2).y);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
45
What will be the output of the following C code?
#include <stdio.h>
typedef struct student
{
    char *a;
}stu;
void main()
{
    struct student s;
    s.a = "hey";
    printf("%s", s.a);
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
46
What will be the output of the following C code?
#include <stdio.h>
struct p
{
    char x : 2;
    int y : 2;
};
int main()
{
    struct p p;
    p.x = 2;
    p.y = 1;
    p.x = p.x & p.y;
    printf("%d\n", p.x);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
47
What will be the output of the following C code?
#include <stdio.h>
typedef struct p *q;
int main()
{
    struct p
    {
        int x;
        char y;
        q ptr;
    };
    struct p p = {1, 2, &p};
    printf("%d\n", p.ptr->x);
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
48
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.p.x = 2;
    printf("%d\n", u.p.x);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
49
What will be the output of the following C code?
#include <stdio.h>
struct p
{
    unsigned int x : 7;
    unsigned int y : 2;
};
int main()
{
    struct p p;
    p.x = 110;
    p.y = 2;
    printf("%d\n", p.x);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
50
Which of the following technique is faster for travelling in binary trees?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board