GATE | Sudo GATE 2020 Mock III (24 January 2019) | Question 53

The value printed by the following program is _________ .

void f(int* p, int m) 
{ 
	m = m - 5; 
	*p = *p - m; 
	return; 
} 
void main() 
{ 
	int i=10, j=5; 
	f(&i, j); 
	printf("%d", i+j); 
} 

(A) 5
(B) 25
(C) 15
(D) 30


Answer: (C)

Explanation: Option (C) 15 is correct.

filter_none

edit
close

play_arrow

link
brightness_4
code

#include<stdio.h>
  
void f(int* p, int m) 
    m = m - 5; 
    *p = *p - m; 
    return
void main() 
    int i=10, j=5; 
    f(&i, j); 
    printf("%d", i+j); 

chevron_right



Quiz of this Question




My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.