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
What is far pointer in c?
Explain how do you generate random numbers in c?
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
What is array within structure?
What is pointers in c?
What is variable initialization and why is it important?
How can I write a function that takes a format string and a variable number of arguments?
Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant
How can I make it pause before closing the program output window?
What is the explanation for prototype function in c?
Define macros.
What is the use of putchar function?
Explain the difference between malloc() and calloc() in c?
Explain what is the difference between a string and an array?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area