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 / shruti

the values will be x =2 and y = 3.

the variables x and y declared in main() are local to main.

whereas

the variables x and y declared in swap() are local to swap..

the change in the value of the variables in either
function will have zero effect on the other function.

Hence the value remains teh same.

Is This Answer Correct ?    16 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does selection sort work in c?

1045


Why c is a mother language?

1043


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

1141


What are the 3 types of structures?

1035


How can I change their mode to binary?

1124


What are the different types of constants?

1077


How do I get an accurate error status return from system on ms-dos?

1131


what are # pragma staments?

2047


What is function prototype?

1154


GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

1108


Explain how can you check to see whether a symbol is defined?

1205


Why do some versions of toupper act strangely if given an upper-case letter?

1078


What is stack in c?

1084


If I have a char * variable pointing to the name of a function ..

1176


What are the types of arrays in c?

1181