write a program to swap Two numbers without using temp variable.
Answer Posted / yash paranjape
int main()
{
int a,b;
printf("enter the two numbers");
scanf("%d%d",&a,&b);
a^=b^=c^=a;//swap a and b
printf("%d%d",a,b);//numbers r swapped
}
| Is This Answer Correct ? | 82 Yes | 189 No |
Post New Answer View All Answers
What are lookup tables in c?
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
What are the different types of control structures?
Can the curly brackets { } be used to enclose a single line of code?
How can I convert a number to a string?
What are header files in c?
What is the best organizational structure?
What is strcmp in c?
Why & is used in scanf in c?
What are linker error?
What is the difference between functions abs() and fabs()?
How can I implement sets or arrays of bits?
Explain what is a 'locale'?
How can a program be made to print the name of a source file where an error occurs?
Can you write the function prototype, definition and mention the other requirements.