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
What is calloc()?
Suggesting that there can be 62 seconds in a minute?
What are the 4 types of unions?
Is multithreading possible in c?
What is the newline escape sequence?
How arrays can be passed to a user defined function
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
how to capitalise first letter of each word in a given string?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
show how link list can be used to repersent the following polynomial i) 5x+2
What is chain pointer in c?
What is null in c?
How can you call a function, given its name as a string?
What is the use of typedef in structure in c?
Is exit(status) truly equivalent to returning the same status from main?