194 views

1 Answer

Best answer
5 votes
5 votes
In C, parameters are passed by value.

Here, p1 is having address of a and p2 is having address of p1.

Inside foo, **p2=5 makes the value of a = 5.

*p1 = 6 further changes it to 6.

But a = 7 won't affect the 'a' inside the main as it is a local copy.

Correct Answer: 6.
selected by
Answer:

Related questions

6 votes
6 votes
1 answer
2
gatecse asked Jul 26, 2020
562 views
What will be the output of the following C program?(Assume IEEE -$754$ standard being Used)#include<stdio.h int main() { float a = 8.0625; if(a == 8.0625) { printf("1"); ...
6 votes
6 votes
2 answers
4