Redirected
1,034 views
0 votes
0 votes

 

 

Can anyone explain answer is A

1 Answer

0 votes
0 votes

 

The output should be :

jairam 

garbage value

sriram

sriram

In the main function we declare the array assume it address to be 100 . In the next line f1 is called and address 100 of array is passed . In the first line of f1() character constant is declared so due to this x started pointing to the value stored in the read only section of memory (generally the data section)  . In next line string pointed by x is printed.  After that function activation record is popped of. Now in main function array pointed by arr is printed . As till now it contain garbage value so garbage value is printed. Now in next line no 4 of main f2() is called , here also address 100 is passed . In function f2() array with address 100 is initialized with the value "sriram" . After printing the value f2() get popped off . And in main() string pointed by arr is again printed.

Related questions

0 votes
0 votes
1 answer
1
Vishal Goyal asked Dec 6, 2016
449 views
0 votes
0 votes
1 answer
2
amitarp818 asked Nov 28, 2023
568 views
Consider the following array of elements<96,42,50,17,15,5,7,11,39,23,6,9,19,100,12>The minimum number of interchanges using buildheap needed to convert it into a max heap...