Q221
Open questionSelect an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
253
Questions
12/13
Page
Pick an option on a question to see the right answer and solution.
Q221
Open questionSelect an option to see the answer and solution.
Q222
Open questionint **ptr;Select an option to see the answer and solution.
Q223
Open question#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]);
}Select an option to see the answer and solution.
Q224
Open question#include <stdio.h>
int main()
{
char str[] = "hello, world";
str[5] = '.';
printf("%s\n", str);
return 0;
}Select an option to see the answer and solution.
Q225
Open question#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);
}Select an option to see the answer and solution.
Q226
Open questionSelect an option to see the answer and solution.
Q227
Open question#include <stdio.h>
void main()
{
char a[10][5] = {"hi", "hello", "fellows"};
printf("%d", sizeof(a[1]));
}Select an option to see the answer and solution.
Q228
Open questionint *a[] = {{1, 2, 3}, {1, 2, 3, 4}}; //- 1
int b[4][4] = {{1, 2, 3}, {1, 2, 3, 4}};//- 2Select an option to see the answer and solution.
Q229
Open question#include <stdio.h>
void first()
{
printf("first");
}
void second()
{
first();
}
void third()
{
second();
}
void main()
{
void (*ptr)();
ptr = third;
ptr();
}Select an option to see the answer and solution.
Q230
Open questionSelect an option to see the answer and solution.
Q231
Open question(Assuming the function to be assigned is "int multi(int, int);")Select an option to see the answer and solution.
Q232
Open question#include <stdio.h>
struct student
{
int no = 5;
char name[20];
};
void main()
{
struct student s;
s.no = 8;
printf("hello");
}Select an option to see the answer and solution.
Q233
Open questionSelect an option to see the answer and solution.
Q234
Open question#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;
}Select an option to see the answer and solution.
Q235
Open question#include <stdio.h>
void fun(char *k)
{
printf("%s", k);
}
void main()
{
char s[] = "hello";
fun(s);
}Select an option to see the answer and solution.
Q236
Open question#include <stdio.h>
int main()
{
int i = 0, j = 1;
int *a[] = {&i, &j};
printf("%d", *a[0]);
return 0;
}Select an option to see the answer and solution.
Q237
Open question#include <stdio.h>
int main()
{
int *ptr, a = 10;
ptr = &a;
*ptr += 1;
printf("%d,%d/n", *ptr, a);
}Select an option to see the answer and solution.
Q238
Open question#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;
}Select an option to see the answer and solution.
Q239
Open questionint *a[] = {{1, 2, 3}, {1, 2, 3, 4}}; //- 1
int b[][] = {{1, 2, 3}, {1, 2, 3, 4}}; //- 2Select an option to see the answer and solution.
Q240
Open questionSelect an option to see the answer and solution.