91. What will be the output of the following C code?
#include <stdio.h>
void main()
{
char a[10][5] = {"hi", "hello", "fellows"};
printf("%s", a[2]);
}
#include <stdio.h>
void main()
{
char a[10][5] = {"hi", "hello", "fellows"};
printf("%s", a[2]);
}
92. What will be the output of the following C code (considering sizeof char is 1 and pointer is 4)?
#include <stdio.h>
int main()
{
char *a[2] = {"hello", "hi"};
printf("%d", sizeof(a));
return 0;
}
#include <stdio.h>
int main()
{
char *a[2] = {"hello", "hi"};
printf("%d", sizeof(a));
return 0;
}
93. In linux, argv[0] by command-line argument can be occupied by . . . . . . . .
94. What will be the output of the following C code?
#include <stdio.h>
int main()
{
char *p[1] = {"hello"};
printf("%s", (p)[0]);
return 0;
}
#include <stdio.h>
int main()
{
char *p[1] = {"hello"};
printf("%s", (p)[0]);
return 0;
}
95. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int a[3] = {1, 2, 3};
int *p = a;
int *r = &p;
printf("%d", (**r));
}
#include <stdio.h>
void main()
{
int a[3] = {1, 2, 3};
int *p = a;
int *r = &p;
printf("%d", (**r));
}
96. What will be the output of the following C code?
#include <stdio.h>
int main()
{
char *str = "hello world";
char strary[] = "hello world";
printf("%d %d\n", sizeof(str), sizeof(strary));
return 0;
}
#include <stdio.h>
int main()
{
char *str = "hello world";
char strary[] = "hello world";
printf("%d %d\n", sizeof(str), sizeof(strary));
return 0;
}
97. An array of similar data types which themselves are a collection of dissimilar data type are . . . . . . . .
98. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a[4] = {1, 2, 3, 4};
int b[4] = {1, 2, 3, 4};
int n = &b[3] - &a[2];
printf("%d\n", n);
}
#include <stdio.h>
int main()
{
int a[4] = {1, 2, 3, 4};
int b[4] = {1, 2, 3, 4};
int n = &b[3] - &a[2];
printf("%d\n", n);
}
99. What will be the output of the following C code?
#include <stdio.h>
void f(int a[][3])
{
a[0][1] = 3;
int i = 0, j = 0;
for (i = 0; i < 2; i++)
for (j = 0; j < 3; j++)
printf("%d", a[i][j]);
}
void main()
{
int a[2][3] = {0};
f(a);
}
#include <stdio.h>
void f(int a[][3])
{
a[0][1] = 3;
int i = 0, j = 0;
for (i = 0; i < 2; i++)
for (j = 0; j < 3; j++)
printf("%d", a[i][j]);
}
void main()
{
int a[2][3] = {0};
f(a);
}
100. What will be the output of the following C code?
#include <stdio.h>
void (*(f)())(int, float);
typedef void (*(*x)())(int, float);
void foo(int i, float f);
int main()
{
x = f;
x();
}
void (*(f)())(int, float)
{
return foo;
}
void foo(int i, float f)
{
printf("%d %f\n", i, f);
}
#include <stdio.h>
void (*(f)())(int, float);
typedef void (*(*x)())(int, float);
void foo(int i, float f);
int main()
{
x = f;
x();
}
void (*(f)())(int, float)
{
return foo;
}
void foo(int i, float f)
{
printf("%d %f\n", i, f);
}
Read More Section(Pointer)
Each Section contains maximum 100 MCQs question on Pointer. To get more questions visit other sections.