Q241
Open question#include <stdio.h>
void main()
{
char *s = "hello";
char *p = s;
printf("%c\t%c", *(p + 1), 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
13/13
Page
Pick an option on a question to see the right answer and solution.
Q241
Open question#include <stdio.h>
void main()
{
char *s = "hello";
char *p = s;
printf("%c\t%c", *(p + 1), s[1]);
}Select an option to see the answer and solution.
Q242
Open questionSelect an option to see the answer and solution.
Q243
Open question#include <stdio.h>
int main()
{
double *ptr = (double *)100;
ptr = ptr + 2;
printf("%u", ptr);
}Select an option to see the answer and solution.
Q244
Open questionSelect an option to see the answer and solution.
Q245
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.
Q246
Open question#include <stdio.h>
void main()
{
struct student
{
int no;
char name[20];
};
struct student s;
s.no = 8;
printf("%s", s.name);
}Select an option to see the answer and solution.
Q247
Open question#include <stdio.h>
int main()
{
int ary[4] = {1, 2, 3, 4};
int *p = ary + 3;
printf("%d %d\n", p[-2], ary[*p]);
}Select an option to see the answer and solution.
Q248
Open question#include <stdio.h>
void m(int p, int q)
{
printf("%d %d\n", p, q);
}
void main()
{
int a = 6, b = 5;
m(a);
}Select an option to see the answer and solution.
Q249
Open question#include <stdio.h>
void f(int (*x)(int));
int myfoo(int);
int (*fooptr)(int);
int ((*foo(int)))(int);
int main()
{
fooptr = foo(0);
fooptr(10);
}
int ((*foo(int i)))(int)
{
return myfoo;
}
int myfoo(int i)
{
printf("%d\n", i + 1);
}Select an option to see the answer and solution.
Q250
Open questionSelect an option to see the answer and solution.
Q251
Open question#include <stdio.h>
int main(int argc, char *argv[])
{
printf("%s\n", argv[argc]);
return 0;
}Select an option to see the answer and solution.
Q252
Open question#include <stdio.h>
void f(int);
void (*foo)(void) = 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.
Q253
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.