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 / shankar

Value remain same hare....I.E :- X=2,y=3.Because here rules of call by value is applied. If we use call by reference the only value is changed .

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how do you declare an array that will hold more than 64kb of data?

1025


design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.

1599


What are void pointers in c?

669


What is adt in c programming?

723


Is c is a low level language?

651






Explain what is the difference between null and nul?

768


What is an endless loop?

923


Compare array data type to pointer data type

702


Explain what happens if you free a pointer twice?

706


What is wrong with this statement? Myname = 'robin';

925


Is c is a middle level language?

696


Is there a way to jump out of a function or functions?

748


Why is void main used?

700


Tell us two differences between new () and malloc ()?

711


Can you explain the four storage classes in C?

758