ExamVeda
Login
Home
41
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    struct student
    {
        int no;
        char name[20];
    };
    struct student s;
    no = 8;
    printf("%d", no);
}
Discuss
Answer & Solution
Answer: Option B
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 p
{
    int x;
    char y;
};
int main()
{
    struct p p1[] = {1, 92, 3, 94, 5, 96};
    struct p *ptr1 = p1;
    int x = (sizeof(p1) / sizeof(struct p));
    printf("%d %d\n", ptr1->x, (ptr1 + x - 1)->x);
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
43
What will be the output of the following C code?
#include <stdio.h>
struct point
{
    int x;
    int y;
};
int main()
{
    struct point p = {1};
    struct point p1 = {1};
    if(p == p1)
        printf("equal\n");
    else
        printf("not equal\n");
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
44
Which of the following structure declaration doesn't require pass-by-reference?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
45
How many bytes in memory taken by the following C structure?
#include <stdio.h>
struct test
{
    int k;
    char c;
};
Discuss
Answer & Solution
Answer: Option A
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>
typedef struct p
{
    int x, y;
}k;
int main()
{
    struct p p = {1, 2};
    k k1 = p;
    printf("%d\n", k1.x);
}
Discuss
Answer & Solution
Answer: Option B
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>
void main()
{
    char *a[3] = {"hello", "this"};
    printf("%s", a[1]);
}
Discuss
Answer & Solution
Answer: Option C
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>
struct student
{
    char *name;
};
struct student fun(void)
{
    struct student s;
    s.name = "alan";
    return s;
}
void main()
{
    struct student m = fun();
    printf("%s", m.name);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
49
What is the correct syntax to declare a function foo() which receives an array of structure in function?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
50
What will be the output of the following C code?
#include <stdio.h>
struct student
{
    char *c;
};
void main()
{
    struct student *s;
    s->c = "hello";
    printf("%s", s->c);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board