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
How can I read a binary data file properly?
What is the role of && operator in a program code?
using only #include
I need a sort of an approximate strcmp routine?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
Why do we use pointer to pointer in c?
Can i use “int” data type to store the value 32768? Why?
Difference between Function to pointer and pointer to function
What are inbuilt functions in c?
What is the use of extern in c?
Differentiate fundamental data types and derived data types in C.
What is the deal on sprintf_s return value?
Explain what is a pragma?
What are the advantages of using Unions?
What is c language used for?