#include <stdio.h>
void main()
{
char *s = "hello";
char *p = s * 3;
printf("%c\t%c", *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
4/13
Page
Pick an option on a question to see the right answer and solution.
#include <stdio.h>
void main()
{
char *s = "hello";
char *p = s * 3;
printf("%c\t%c", *p, s[1]);
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
int (*a)[7];Select an option to see the answer and solution.
#include <stdio.h>
int main()
{
int *p = (int *)2;
int *q = (int *)3;
printf("%d", p + q);
}Select an option to see the answer and solution.
P. Pointer to Array
Q. Multi-dimensional arraySelect an option to see the answer and solution.
#include <stdio.h>
void main()
{
char *s= "hello";
char *p = s;
printf("%c\t%c", p[0], s[1]);
}Select an option to see the answer and solution.
#include <stdio.h>
int main(int argc, char *argv[])
{
while (argc--)
printf("%s\n", argv[argc]);
return 0;
}Select an option to see the answer and solution.
#include <stdio.h>
int main()
{
int a[4] = {1, 2, 3, 4};
int *p = &a[1];
int *ptr = &a[2];
ptr = ptr * 1;
printf("%d\n", *ptr);
}Select an option to see the answer and solution.
#include <stdio.h>
void f(char *k)
{
k++;
k[2] = 'm';
}
void main()
{
char s[] = "hello";
f(s);
printf("%c\n", *s);
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
#include <stdio.h>
int main()
{
int i = 10;
void *p = &i;
printf("%d\n", (int)*p);
return 0;
}Select an option to see the answer and solution.
#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.
#include <stdio.h>
int main()
{
const int ary[4] = {1, 2, 3, 4};
int *p;
p = ary + 3;
*p = 5;
printf("%d\n", ary[3]);
}Select an option to see the answer and solution.
#include <stdio.h>
void foo( int[] );
int main()
{
int ary[4] = {1, 2, 3, 4};
foo(ary);
printf("%d ", ary[0]);
}
void foo(int p[4])
{
int i = 10;
p = &i;
printf("%d ", p[0]);
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
#include <stdio.h>
void main()
{
int a[3] = {1, 2, 3};
int *p = a;
printf("%p\t%p", p, a);
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
#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.
#include <stdio.h>
void m(int *p)
{
int i = 0;
for(i = 0;i < 5; i++)
printf("%d\t", p[i]);
}
void main()
{
int a[5] = {6, 5, 3};
m(&a);
}Select an option to see the answer and solution.