Pointer - Study Mode

[#156] What will be the output of the following C code? #include <stdio.h>
int main()
{
int *((*x)())[2]
x()
printf("after x
")
}
int *((*x)())[2]
{
int **str
str = (int*)malloc(sizeof(int)* 2)
return str
}
Correct Answer

(A) Compile time error

[#157] What will be the output of the following C code? #include <stdio.h>
void main()
{
int k = 5
int *p = &k
int **m = &p
**m = 6
printf("%d
", k)
}
Correct Answer

(C) 6
(G) 6

[#158] What will be the output of the following C code? #include <stdio.h>
int *f()
int main()
{
int *p = f()
printf("%d
", *p)
}
int *f()
{
int j = 10
return &j
}
Correct Answer

(A) 10

[#159] What will be the output of the following C code? #include <stdio.h>
struct student
{
int no
char name[20]
}
void main()
{
student s
s.name = "hello"
printf("hello")
}
Correct Answer

(C) Compile time error

[#160] Which of the following are generated from char pointer?
Correct Answer

(A) char *string = "Hello."