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?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
Where define directive used?
C program to find all possible outcomes of a dice?
Why is C language being considered a middle level language?
differentiate built-in functions and user – defined functions.
Explain how can you determine the size of an allocated portion of memory?
What is the use of #define preprocessor in c?
how to capitalise first letter of each word in a given string?
Can the “if” function be used in comparing strings?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
Explain what is the benefit of using enum to declare a constant?
Is this program statement valid? INT = 10.50;
What functions are in conio h?
Explain how are portions of a program disabled in demo versions?