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
How do you determine the length of a string value that was stored in a variable?
Explain what are multibyte characters?
write a c program to find the sum of five entered numbers using an array named number
Explain the priority queues?
Can one function call another?
Explain is it better to bitshift a value than to multiply by 2?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
Which one would you prefer - a macro or a function?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
to find the closest pair
What is wrong with this declaration?
how to execute a program using if else condition and the output should enter number and the number is odd only...
What is const and volatile in c?
Can you think of a logic behind the game minesweeper.