ExamVeda
Login
Home
21
One of the uses for function pointers in C is . . . . . . . .
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
22
Comment on the following pointer declaration.
int *ptr, p;
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
23
What will be the output of the following C code?
#include <stdio.h>
void f(int);
void (*foo)() = f;
int main(int argc, char *argv[])
{
    foo(10);
    return 0;
}
void f(int i)
{
    printf("%d\n", i);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
24
What will be the output of the following C code?
#include <stdio.h>
void foo(int*);
int main()
{
    int i = 10, *p = &i;
    foo(p++);
}
void foo(int *p)
{
    printf("%d\n", *p);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
25
What will be the output of the following C code?
#include <stdio.h>
void (*(f)())(int, float);
typedef void (*(*x)())(int, float);
void foo(int i, float f);
int main()
{
    x p = f;
    p();
}
void (*(f)())(int, float)
{
    return foo;
}
void foo(int i, float f)
{
    printf("%d %f\n", i, f);
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
26
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
27
What are the elements present in the array of the following C code?
int array[5] = {5};
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
28
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
29
What will be the output of the following C code?
#include <stdio.h>
void foo(float *);
int main()
{
    int i = 10, *p = &i;
    foo(&i);
}
void foo(float *p)
{
    printf("%f\n", *p);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
30
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    char *a[10] = {"hi", "hello", "how"};
    int i = 0, j = 0;
    a[0] = "hey";
    for (i = 0;i < 10; i++)
    printf("%s\n", a[i]);
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board