Pointer - Study Mode
[#96] What will be the output of the following C code? #include <stdio.h>
int mul(int a, int b, int c)
{
return a * b * c
}
void main()
{
int *function_pointer
function_pointer = mul
printf("The product of three numbers is:%d",
function_pointer(2, 3, 4))
}
Correct Answer
(B) Compile time error
[#97] What will be the output of the following C code? #include <stdio.h>
int main()
{
int ary[4] = {1, 2, 3, 4}
int *p = ary + 3
printf("%d
", p[-2])
}
Correct Answer
(B) 2
[#98] What will be the output of the following C code? #include <stdio.h>
int x = 0
void main()
{
int *ptr = &x
printf("%p
", ptr)
x++
printf("%p
", ptr)
}
Correct Answer
(A) Same address
[#99] What will be the output of the following C code? #include <stdio.h>
struct student
{
int no = 5
char name[20]
}
void main()
{
struct student s
s.no = 8
printf("hello")
}
Correct Answer
(B) Compile time error
[#100] Which is true for a, if a is defined as "int a[10][20]
"?
Correct Answer
(D) All of the mentioned