ExamVeda
Login
Home
31
What is the correct way to declare and assign a function pointer?
(Assuming the function to be assigned is "int multi(int, int);")
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
32
What will be the output of the following C code?
#include <stdio.h>
struct student
{
    int no = 5;
    char name[20];
};
void main()
{
    struct student s;
    s.no = 8;
    printf("hello");
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
33
What type of array is generally generated in Command-line argument?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
34
What will be the output of the following C code?
#include <stdio.h>
void f(int (*x)(int));
int myfoo(int i);
int (*foo)(int) = myfoo;
int main()
{
    f(foo(10));
}
void f(int (*i)(int))
{
    i(11);
}
int myfoo(int i)
{
    printf("%d\n", i);
    return i;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
35
What will be the output of the following C code?
#include <stdio.h>
void fun(char *k)
{
    printf("%s", k);
}
void main()
{
    char s[] = "hello";
    fun(s);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
36
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 0, j = 1;
    int *a[] = {&i, &j};
    printf("%d", *a[0]);
    return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
37
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int *ptr, a = 10;
    ptr = &a;
    *ptr += 1;
    printf("%d,%d/n", *ptr, a);
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
38
What will be the output of the following C code?
#include <stdio.h>
int *f();
int main()
{
    int *p = f();
    printf("%d\n", *p);
}
int *f()
{
    int *j = (int*)malloc(sizeof(int));
    *j = 10;
    return j;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
39
Comment on the following two operations.
int *a[] = {{1, 2, 3}, {1, 2, 3, 4}}; //- 1
int b[][] = {{1, 2, 3}, {1, 2, 3, 4}}; //- 2
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
40
Which of the following is a correct syntax to pass a Function Pointer as an argument?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board