GATE CS 2015, set 1 · Question 34 · Programming and Data Structures · Numerical answer (NAT) · 1 mark · no negative marks
The output of the following C program is ______.
void f1(int a, int b) { int c; c=a; a=b; b=c; } void f2(int *a, int *b) { int c; c=*a; *a=*b; *b=c; } int main(){ int a=4, b=5, c=6; f1(a,b); f2(&b, &c); printf("%d",c-a-b); }
Answer
Answer -5
Answer from the official GATE CS 2015 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes