i=0; a = 1; b = 4; swap(int a, int b) { int temp; temp = a; a = b; b = a; i = 1; } What is the output? A. 4 0 0 B. 0 4 1 C. 1 4 1 D. Error

Showing Answers 1 - 6 of 6 Answers

shahistha

  • Dec 5th, 2005
 

Answer is :D(Error)

  Was this answer useful?  Yes

hariganesh.b

  • Jul 23rd, 2006
 

d.error

  Was this answer useful?  Yes

sandeep nikam

  • Aug 2nd, 2007
 

output: d error

  Was this answer useful?  Yes

ramumcato

  • May 30th, 2008
 

Answer is C. ( 1 4 1 )

outside function first time :   a is 1
insdie function a is 4
outside function again a is 1

Note : variabel "a"  is not the same inside and outside variables. They are different. Changing of the value inside the function will be affected outside of funcion

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions