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
What is cohesion in c?
cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration
What are the keywords in c?
Explain what is wrong with this program statement?
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
Explain logical errors? Compare with syntax errors.
What is the maximum length of an identifier?
What is 02d in c?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
How many keywords (reserve words) are in c?
why we wont use '&' sing in aceesing the string using scanf
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
What is bss in c?
What is function definition in c?
What is data structure in c and its types?