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

Differentiate between null and void pointers.

1116


What is meant by realloc()?

1084


Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

1045


write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

15928


code for replace tabs with equivalent number of blanks

2099


What are the 5 elements of structure?

1040


Tell me what is null pointer in c?

1012


What is the difference between char array and char pointer?

982


How does sizeof know array size?

1070


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

2307


Implement bit Array in C.

1096


What is #define?

1038


what do you mean by inline function in C?

1007


How can a program be made to print the name of a source file where an error occurs?

1175


any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

1096