C - Functions - Discussion

You Are Here :: Home > C > Functions - Discussion

 



Q.

What is the output of the following program?

main()
{
int x=20;
int y=10;
swap(x,y);
printf("%d %d",y,x+2);
}
swap(int x,int y)
{
int temp;
temp =x;
x=y;
y=temp;
}

A. 10,20 B. 20,12
C. 22,10 D. 10,22

Answer: Option D
Explaination:

 


x= 20 ,x+2 = 22

so y= 10,x=22



Discussion

Your Comments Goes here...
NameDiscussion