Q121
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
7/13
Page
Pick an option on a question to see the right answer and solution.
Q121
Open questionSelect an option to see the answer and solution.
Q122
Open questionint *ptr, p;Select an option to see the answer and solution.
Q123
Open question#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);
}Select an option to see the answer and solution.
Q124
Open question#include <stdio.h>
void foo(int*);
int main()
{
int i = 10, *p = &i;
foo(p++);
}
void foo(int *p)
{
printf("%d\n", *p);
}Select an option to see the answer and solution.
Q125
Open question#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);
}Select an option to see the answer and solution.
Q126
Open question#include <stdio.h>
void main()
{
struct student
{
int no;
char name[20];
};
struct student s;
s.no = 8;
printf("%d", s.no);
}Select an option to see the answer and solution.
Q127
Open questionint array[5] = {5};Select an option to see the answer and solution.
Q128
Open question#include <stdio.h>
struct student
{
int no;
char name[20];
};
void main()
{
student s;
s.no = 8;
printf("hello");
}Select an option to see the answer and solution.
Q129
Open question#include <stdio.h>
void foo(float *);
int main()
{
int i = 10, *p = &i;
foo(&i);
}
void foo(float *p)
{
printf("%f\n", *p);
}Select an option to see the answer and solution.
Q130
Open question#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]);
}Select an option to see the answer and solution.
Q131
Open questionSelect an option to see the answer and solution.
Q132
Open question#include <stdio.h>
void f(int a[][])
{
a[0][1] = 3;
int i = 0, j = 0;
for (i = 0;i < 2; i++)
for (j = 0;j < 3; j++)
printf("%d", a[i][j]);
}
void main()
{
int a[2][3] = {0};
f(a);
}Select an option to see the answer and solution.
Q133
Open questionSelect an option to see the answer and solution.
Q134
Open question#include <stdio.h>
void main()
{
int k = 5;
int *p = &k;
int **m = &p;
printf("%d%d%d\n", k, *p, **m);
}Select an option to see the answer and solution.
Q135
Open questionSelect an option to see the answer and solution.
Q136
Open question#include <stdio.h>
int main()
{
int a[4] = {1, 2, 3, 4};
int *ptr = &a[2];
float n = 1;
ptr = ptr + n;
printf("%d\n", *ptr);
}Select an option to see the answer and solution.
Q137
Open questionSelect an option to see the answer and solution.
Q138
Open question#include <stdio.h>
void f(int (*x)(int));
int myfoo(int);
int (*foo)() = myfoo;
int main()
{
f(foo);
}
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.
Q139
Open questionint *a1[8];
int *(a2[8]);
P. Array of pointers
Q. Pointer to an arraySelect an option to see the answer and solution.
Q140
Open question#include <stdio.h>
int main()
{
int i = 10;
void *p = &i;
printf("%f\n", *(float*)p);
return 0;
}Select an option to see the answer and solution.