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
Explain what are bus errors, memory faults, and core dumps?
What is conio h in c?
What is the scope of an external variable in c?
Explain goto?
Why does not c have an exponentiation operator?
What does main () mean in c?
What are c header files?
Is main is a keyword in c?
Can a program have two main functions?
How we can insert comments in a c program?
Are comments included during the compilation stage and placed in the EXE file as well?
What is the translation phases used in c language?
What is difference between class and structure?
Explain enumerated types in c language?
How do I use strcmp?