ExamVeda
Login
Home
21
What is the index of the last argument in command line arguments?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
22
What makes the following declaration denote?
int **ptr;
Discuss
Answer & Solution
Answer: Option B
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>
int main()
{
    foo(ary);
}
void foo(int **ary)
{
    int i = 10, k = 20, j = 30;
    int *ary[2];
    ary[0] = &i;
    ary[1] = &j;
    printf("%d\n", ary[0][1]);
}
Discuss
Answer & Solution
Answer: Option D
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>
int main()
{
    char str[] = "hello, world";
    str[5] = '.';
    printf("%s\n", str);
    return 0;
}
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>
int main()
{
    int i = 10;
    int *const p = &i;
    foo(&p);
    printf("%d\n", *p);
}
void foo(int **p)
{
    int j = 11;
    *p = &j;
    printf("%d\n", **p);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
26
Which of the following arithmetic operation can be applied to pointers a and b?
(Assuming initialization as int *a = (int *)2; int *b = (int *)3;)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
27
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    char a[10][5] = {"hi", "hello", "fellows"};
    printf("%d", sizeof(a[1]));
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
28
Comment on the following two operations.
int *a[] = {{1, 2, 3}, {1, 2, 3, 4}}; //- 1
int b[4][4] = {{1, 2, 3}, {1, 2, 3, 4}};//- 2
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
29
Which function is not called in the following C program?
#include <stdio.h>
void first()
{
    printf("first");
}
void second()
{
    first();
}
void third()
{
    second();
}
void main()
{
    void (*ptr)();
    ptr = third;
    ptr();
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
30
Which of the following syntax is correct for command-line arguments?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board