Write a program to interchange two variables without using
the third variable?
Answer Posted / vijay r15
using many ways we can
perform
#include<stdio.H>
void main()
{
int a=10,b=20;
b=a+b-(a=b);
//or use a^=b^=a^=b;
//or use a=a+b;b=a-
b;a=a-b;
//or use a^=b; b^=a;
a^=b;
printf("%d%d",a,b);
}
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
Explain how do you list files in a directory?
Explain enumerated types in c language?
Why is c called "mother" language?
What is the difference between far and near ?
What is 02d in c?
Explain about the functions strcat() and strcmp()?
Explain why can’t constant values be used to define an array’s initial size?
What is return type in c?
Explain how can you tell whether a program was compiled using c versus c++?
What is sorting in c plus plus?
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
What is the basic structure of c?
Tell me the use of bit field in c language?
How are 16- and 32-bit numbers stored?
Explain the Difference between the New and Malloc keyword.