ExamVeda
Login
Home
91
What will be the output of the following C code?
#include <stdio.h>
struct student
{
    char *c;
    struct student *point;
};
void main()
{
    struct student s;
    struct student *m = &s;
    printf("%d", sizeof(student));
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
92
What will be the output of the following C code?
#include <stdio.h>
int (*(x()))[2];
typedef int (*(*ptr)())[2] ptrfoo;
int main()
{
    ptrfoo ptr1;
    ptr1 = x;
    ptr1();
    return 0;
}
int (*(x()))[2]
{
    int (*ary)[2] = malloc(sizeof*ary);
    return &ary;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
93
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};
    foo(&p1);
}
void foo(struct point *p)
{
    printf("%d\n", *p->x++);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
94
What will be the output of the following C code?
#include <stdio.h>
struct student
{
    char *c;
    struct student point;
};
void main()
{
    struct student s;
    s.c = "hello";
    printf("%s", s.c);
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
95
What will be the output of the following C code?
#include <stdio.h>
struct p
{
    unsigned int x : 1;
    unsigned int y : 1;
};
int main()
{
    struct p p;
    p.x = 1;
    p.y = 2;
    printf("%d\n", p.y);
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
96
Members of a union are accessed as . . . . . . . .
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
97
Which option should be selected to work the following C expression?
string p = "HELLO";
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
98
What will be the output of the following C code?
#include <stdio.h>
struct p
{
   int x;
   int y;
};
int main()
{
   struct p p1[] = {1, 92, 3, 94, 5, 96};
   struct p *ptr1 = p1;
   int x = (sizeof(p1) / 5);
   if (x == 3)
       printf("%d %d\n", ptr1->x, (ptr1 + x - 1)->x);
   else
       printf("false\n");
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
99
Which of the following data types are accepted while declaring bit-fields?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
100
What will be the output of the following C code?
#include <stdio.h>
struct student
{
    char *name;
};
struct student fun(void)
{
    struct student s;
    s.name = "alan";
    return s;
}
void main()
{
    struct student m = fun();
    s.name = "turing";
    printf("%s", m.name);
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board