Q201
Open question#include <stdio.h>
void main()
{
struct student
{
int no;
char name[20];
};
struct student s;
no = 8;
printf("%d", no);
}Select 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
11/13
Page
Pick an option on a question to see the right answer and solution.
Q201
Open question#include <stdio.h>
void main()
{
struct student
{
int no;
char name[20];
};
struct student s;
no = 8;
printf("%d", no);
}Select an option to see the answer and solution.
Q202
Open questionSelect an option to see the answer and solution.
Q203
Open question#include <stdio.h>
void main()
{
char *a[10] = {"hi", "hello", "how"};
int i = 0;
for (i = 0;i < 10; i++)
printf("%s", a[i]);
}Select an option to see the answer and solution.
Q204
Open question#include <stdio.h>
void main()
{
char *s= "hello";
char *p = s + 2;
printf("%c\t%c", *p, s[1]);
}Select an option to see the answer and solution.
Q205
Open question#include <stdio.h>
void main()
{
int k = 5;
int *p = &k;
int **m = &p;
printf("%d%d%d\n", k, *p, **p);
}Select an option to see the answer and solution.
Q206
Open question#include <stdio.h>
void foo(int (*ary)[3]);
int main()
{
int ary[2][3];
foo(ary);
}
void foo(int (*ary)[3])
{
int i = 10, j = 2, k;
ary[0] = &i;
ary[1] = &j;
for (k = 0;k < 2; k++)
printf("%d\n", *ary[k]);
}Select an option to see the answer and solution.
Q207
Open question#include <stdio.h>
int main()
{
char *a[1] = {"hello"};
printf("%s", a[0]);
return 0;
}Select an option to see the answer and solution.
Q208
Open questionint (*(*y)())[2];Select an option to see the answer and solution.
Q209
Open question#include <stdio.h>
int x = 0;
void main()
{
int *const ptr = &x;
printf("%p\n", ptr);
ptr++;
printf("%p\n ", ptr);
}Select an option to see the answer and solution.
Q210
Open questionint (*ptr)(); // i)
char *ptr[]; // ii)Select an option to see the answer and solution.
Q211
Open questionSelect an option to see the answer and solution.
Q212
Open questionSelect an option to see the answer and solution.
Q213
Open questionSelect an option to see the answer and solution.
Q214
Open questionptr is array with 3 elements of pointer to function returning pointer of intSelect an option to see the answer and solution.
Q215
Open question#include <stdio.h>
int main()
{
char a[2][6] = {"hello", "hi"};
printf("%d", sizeof(a));
return 0;
}Select an option to see the answer and solution.
Q216
Open question#include <stdio.h>
int main()
{
int a[4] = {1, 2, 3, 4};
void *p = &a[1];
void *ptr = &a[2];
int n = 1;
n = ptr - p;
printf("%d\n", n);
}Select an option to see the answer and solution.
Q217
Open question#include <stdio.h>
void main()
{
int x = 0;
int *ptr = &x;
printf("%p\n", ptr);
ptr++;
printf("%p\n ", ptr);
}Select an option to see the answer and solution.
Q218
Open questionSelect an option to see the answer and solution.
Q219
Open questionSelect an option to see the answer and solution.
Q220
Open questionSelect an option to see the answer and solution.