Q181
Open question#include <stdio.h>
void main()
{
char *s= "hello";
char *p = s;
printf("%c\t%c", 1[p], s[1]);
}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
10/13
Page
Pick an option on a question to see the right answer and solution.
Q181
Open question#include <stdio.h>
void main()
{
char *s= "hello";
char *p = s;
printf("%c\t%c", 1[p], s[1]);
}Select an option to see the answer and solution.
Q182
Open question#include <stdio.h>
struct student
{
int no;
char name[20];
}
void main()
{
struct student s;
s.no = 8;
printf("hello");
}Select an option to see the answer and solution.
Q183
Open question#include <stdio.h>
void main()
{
int a[2][3] = {1, 2, 3, 4, 5};
int i = 0, j = 0;
for (i = 0; i < 2; i++)
for (j = 0; j < 3; j++)
printf("%d", a[i][j]);
}Select an option to see the answer and solution.
Q184
Open questionSelect an option to see the answer and solution.
Q185
Open questionprintf(“%s\n”, argv[argc]);Select an option to see the answer and solution.
Q186
Open question#include <stdio.h>
int main()
{
char a[2][6] = {"hello", "hi"};
printf("%s", *a + 1);
return 0;
}Select an option to see the answer and solution.
Q187
Open question#include <stdio.h>
int main()
{
char *str = "hello world";
char strc[] = "good morning india\n";
strcpy(strc, str);
printf("%s\n", strc);
return 0;
}Select an option to see the answer and solution.
Q188
Open question#include <stdio.h>
void m(int p)
{
printf("%d\n", p);
}
void main()
{
int a = 6, b = 5;
m(a, b);
printf("%d %d\n", a, b);
}Select an option to see the answer and solution.
Q189
Open question#include <stdio.h>
void main()
{
char *a[10] = {"hi", "hello", "how"};
printf("%d\n", sizeof(a));
}Select an option to see the answer and solution.
Q190
Open question#include <stdio.h>
int sub(int a, int b, int c)
{
return a - b - c;
}
void main()
{
int (*function_pointer)(int, int, int);
function_pointer = ⊂
printf("The difference of three numbers is:%d",
(*function_pointer)(2, 3, 4));
}Select an option to see the answer and solution.
Q191
Open questionSelect an option to see the answer and solution.
Q192
Open question#include <stdio.h>
int main()
{
char *a[2] = {"hello", "hi"};
printf("%s", *(a + 1));
return 0;
}Select an option to see the answer and solution.
Q193
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.
Q194
Open question#include <stdio.h>
int main()
{
char *p = NULL;
char *q = 0;
if (p)
printf(" p ");
else
printf("nullp");
if (q)
printf("q\n");
else
printf(" nullq\n");
}Select an option to see the answer and solution.
Q195
Open question#include <stdio.h>
int main()
{
int i = 97, *p = &i;
foo(&i);
printf("%d ", *p);
}
void foo(int *p)
{
int j = 2;
p = &j;
printf("%d ", *p);
}Select an option to see the answer and solution.
Q196
Open question#include <stdio.h>
int main()
{
int ary[2][3][4], j = 20;
ary[0][0] = &j;
printf("%d\n", *ary[0][0]);
}Select an option to see the answer and solution.
Q197
Open question#include <stdio.h>
void m(int *p, int *q)
{
int temp = *p; *p = *q; *q = temp;
}
void main()
{
int a = 6, b = 5;
m(&a, &b);
printf("%d %d\n", a, b);
}Select an option to see the answer and solution.
Q198
Open question#include <stdio.h>
int main()
{
int i = 97, *p = &i;
foo(&p);
printf("%d ", *p);
return 0;
}
void foo(int **p)
{
int j = 2;
*p = &j;
printf("%d ", **p);
}Select an option to see the answer and solution.
Q199
Open question#include <stdio.h>
int main()
{
void *p;
int a[4] = {1, 2, 3, 8};
p = &a[3];
int *ptr = &a[2];
int n = p - ptr;
printf("%d\n", n);
}Select an option to see the answer and solution.
Q200
Open questionSelect an option to see the answer and solution.