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

What are the advantages and disadvantages of c language?

562


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

688


If fflush wont work, what can I use to flush input?

615


Explain the difference between exit() and _exit() function?

634


How is null defined in c?

652






What does node * mean?

712


What are the string functions? List some string functions available in c.

605


What is the size of empty structure in c?

595


What is the difference between formatted&unformatted i/o functions?

617


Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer

3843


How do I swap bytes?

630


Write a program to use switch statement.

660


How can I open files mentioned on the command line, and parse option flags?

594


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1451


What is volatile variable how do you declare it?

566