Q141
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
8/13
Page
Pick an option on a question to see the right answer and solution.
Q141
Open questionSelect an option to see the answer and solution.
Q142
Open question#include <stdio.h>
int mul(int a, int b, int c)
{
return a * b * c;
}
void main()
{
int (function_pointer)(int, int, int);
function_pointer = mul;
printf("The product of three numbers is:%d",
function_pointer(2, 3, 4));
}Select an option to see the answer and solution.
Q143
Open question#include <stdio.h>
void main()
{
int x = 0;
int *ptr = &x;
printf("%d\n", *ptr);
}Select an option to see the answer and solution.
Q144
Open questionSelect an option to see the answer and solution.
Q145
Open question#include <stdio.h>
int main()
{
int ary[4] = {1, 2, 3, 4};
int p[4];
p = ary;
printf("%d\n", p[1]);
}Select an option to see the answer and solution.
Q146
Open question#include <stdio.h>
int main()
{
int *((*x)())[2];
x();
printf("after x\n");
}
int *((*x)())[2]
{
int **str;
str = (int*)malloc(sizeof(int)* 2);
return str;
}Select an option to see the answer and solution.
Q147
Open question#include <stdio.h>
void main()
{
int k = 5;
int *p = &k;
int **m = &p;
**m = 6;
printf("%d\n", k);
}Select an option to see the answer and solution.
Q148
Open question#include <stdio.h>
int *f();
int main()
{
int *p = f();
printf("%d\n", *p);
}
int *f()
{
int j = 10;
return &j;
}Select an option to see the answer and solution.
Q149
Open question#include <stdio.h>
struct student
{
int no;
char name[20];
};
void main()
{
student s;
s.name = "hello";
printf("hello");
}Select an option to see the answer and solution.
Q150
Open questionSelect an option to see the answer and solution.
Q151
Open question#include <stdio.h>
void f(char *k)
{
k++;
k[2] = 'm';
printf("%c\n", *k);
}
void main()
{
char s[] = "hello";
f(s);
}Select an option to see the answer and solution.
Q152
Open question#include <stdio.h>
void f(int);
void (*foo)(float) = f;
int main()
{
foo(10);
}
void f(int i)
{
printf("%d\n", i);
}Select an option to see the answer and solution.
Q153
Open questionSelect an option to see the answer and solution.
Q154
Open question#include <stdio.h>
void main()
{
char *s = "hello";
char *n = "cjn";
char *p = s + n;
printf("%c\t%c", *p, s[1]);
}Select an option to see the answer and solution.
Q155
Open question#include <stdio.h>
int mul(int a, int b, int c)
{
return a * b * c;
}
void main()
{
int (*function_pointer)(int, int, int);
function_pointer = mul;
printf("The product of three numbers is:%d",
function_pointer(2, 3, 4));
}Select an option to see the answer and solution.
Q156
Open question#include <stdio.h>
int main()
{
char *str = "This" //Line 1
char *ptr = "Program\n"; //Line 2
str = ptr; //Line 3
printf("%s, %s\n", str, ptr); //Line 4
}Select an option to see the answer and solution.
Q157
Open question#include <stdio.h>
int main()
{
char *a = {"p", "r", "o", "g", "r", "a", "m"};
printf("%s", a);
}Select an option to see the answer and solution.
Q158
Open question#include <stdio.h>
int main(int argc, char *argv[])
{
while (argv != NULL)
printf("%s\n", *(argv++));
return 0;
}Select an option to see the answer and solution.
Q159
Open questionvoid (*ptr)(int);Select an option to see the answer and solution.
Q160
Open question#include <stdio.h>
void main()
{
int a[3] = {1, 2, 3};
int *p = a;
int **r = &p;
printf("%p %p", *r, a);
}Select an option to see the answer and solution.