Pointer - Study Mode
[#91] What will be the output of the following C code (if run with no options or arguments)? #include <stdio.h>
int main(int argc, char *argv[])
{
printf("%d
", argc)
return 0
}
Correct Answer
(B) 1
[#92] Comment on the following C statement. const int *ptr
Correct Answer
(A) You cannot change the value pointed by ptr
[#93] What will be the output of the following C code? #include <stdio.h>
void main()
{
char a[10][5] = {"hi", "hello", "fellows"}
printf("%p
", a)
printf("%p", a[0])
}
Correct Answer
(A) same address is printed
[#94] What will be the output of the following C code on a 32-bit system? #include <stdio.h>
void main()
{
char *a[10] = {"hi", "hello", "how"}
printf("%d
", sizeof(a[1]))
}
Correct Answer
(B) 4
[#95] What will be the output of the following C code? #include <stdio.h>
void f(int a[2][])
{
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)
}
Correct Answer
(C) Compile time error