Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

6)swap(int x,y)
{
int temp;
temp=x;
x=y;
y=temp;
}
main()
{
int x=2;y=3;
swap(x,y);
}
after calling swap ,what are yhe values x&y?

Answer Posted / selloorhari

After calling the function swap(), the values of x,y will be
the same.

i.e. x = 2, y = 3.

The scope of the variables x,y,temp in the swap() function
lies inside the function swap() itself. So there will not be
any change in the values of x,y in the main() function..

Is This Answer Correct ?    17 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is far pointer in c?

1224


Explain how do you generate random numbers in c?

1038


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1621


What is array within structure?

1057


What is pointers in c?

1065


What is variable initialization and why is it important?

1158


How can I write a function that takes a format string and a variable number of arguments?

1000


Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant

1082


How can I make it pause before closing the program output window?

989


What is the explanation for prototype function in c?

920


Define macros.

1217


What is the use of putchar function?

1004


Explain the difference between malloc() and calloc() in c?

1001


Explain what is the difference between a string and an array?

1098


On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area

1069