Pointer - Study Mode
[#171] What will be the output of the following C statement? (assuming the input is "cool brother in city") printf(“%s
”, argv[argc])
Correct Answer
(A) (null)
[#172] What will be the output of the following C code? #include <stdio.h>
int main()
{
char a[2][6] = {"hello", "hi"}
printf("%s", *a + 1)
return 0
}
Correct Answer
(C) ello
[#173] What will be the output of the following C code? #include <stdio.h>
int main()
{
char *str = "hello world"
char strc[] = "good morning india
"
strcpy(strc, str)
printf("%s
", strc)
return 0
}
Correct Answer
(A) hello world
[#174] What will be the output of the following C code? #include <stdio.h>
void m(int p)
{
printf("%d
", p)
}
void main()
{
int a = 6, b = 5
m(a, b)
printf("%d %d
", a, b)
}
Correct Answer
(D) Compile time error
[#175] 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))
}
Correct Answer
(D) 40