in Programming in C edited by
559 views
0 votes
0 votes
swap(int c, int d)
{
    int k,t;
    k=3;
    t=c;
    c=d;
    d=t;
    k=c+d+t;
}
main()
{
    int k=5, l=9;
    swap(k,l);
    printf("%d,%d",k,l);
}
  1. 9,5
  2. 5,9
  3. 5,19
  4. 19,5
in Programming in C edited by
559 views

4 Comments

5 and 9
0
0
plz explain ??
0
0
Here we use simply " Call by Value method"  ,so there is no change in Actual Parameter.

so option B : 5,9  is right
0
0

2 Answers

3 votes
3 votes
Best answer
$printf$ will print the value which the $swap$ function returns

& we can clearly see that the $swap$ function didn't return anything

So, $printf$ will print the argument of $swap$ i.e. $k=5$, $l=9$
selected by
0 votes
0 votes
Answer is option(d)
Answer:

Related questions