The output of the following C program is__________. void f1(int a, int b) {…

GATE · 2015 · CS · Set 1 · Computer Science & IT

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);
}

Attempted by 113 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…