write a program to swap Two numbers without using temp variable.
Answer Posted / ravi saini
void main()
{
int a,b;
printf("enter the two numbers");
scanf("%d%d",&a,&b);
a^=b^=a^=b;
printf("%d%d",a,b);//swapped no
}
Is This Answer Correct ? | 119 Yes | 66 No |
Post New Answer View All Answers
Can I initialize unions?
What are the 5 types of inheritance in c ++?
What is meant by errors and debugging?
Why main is not a keyword in c?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
Explain what are the __date__ and __time__ preprocessor commands?
Is swift based on c?
Are pointers really faster than arrays?
Write a program for finding factorial of a number.
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
What are the complete rules for header file searching?
What does the message "automatic aggregate intialization is an ansi feature" mean?
What are the string functions? List some string functions available in c.
What are all different types of pointers in c?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?