ExamVeda
Login
Home
61
Which of the following is an incorrect syntax to pass by reference a member of a structure in a function?
(Assume: struct temp{int a;}s;)
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
62
What will be the output of the following C code?
#include <stdio.h>
struct student
{
};
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
63
What will be the output of the following C code?
#include <stdio.h>
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);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
64
Which of the following is not possible under any scenario?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
65
Calculate the % of memory saved when bit-fields are used for the following C structure as compared to with-out use of bit-fields for the same structure? (Assuming size of int = 4)
struct temp
{
    int a : 1;
    int b : 2;
    int c : 4;
    int d : 4;
}s;
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
66
What will be the output of the following C code?
#include <stdio.h>
typedef struct student
{
    char *a;
}stu;
void main()
{
    struct stu s;
    s.a = "hi";
    printf("%s", s.a);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
67
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;
    s.no = 8;
    printf("%d", s.no);
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
68
Which of the following statement is true?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
69
What will be the output of the following C code?
#include <stdio.h>
union u
{
    struct p
    {
        unsigned char x : 2;
        unsigned int y : 2;
    };
    int x;
};
int main()
{
    union u 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
70
Which of the given option is the correct method for initialization?
typedef char *string;
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board