write a program in C to swap two variables
Answer Posted / muzammil
#include <stdio.h>
#include <conio.h>
main()
{
int a,b;
printf("Enter the values: ");
scanf("%d%d",&a,&b);
printf("The values before swapping: %d %d",a,b);
a=a-(b=(-b+(a=a+b)));
printf("The values after swapping are: %d %d",a,b);
getch();
}
| Is This Answer Correct ? | 14 Yes | 3 No |
Post New Answer View All Answers
How do you view the path?
explain what is an endless loop?
How do I send escape sequences to control a terminal or other device?
Explain what is gets() function?
What is the c value paradox and how is it explained?
Explain the difference between call by value and call by reference in c language?
Explain what is the benefit of using #define to declare a constant?
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
Are the outer parentheses in return statements really optional?
What is size of union in c?
What is return in c programming?
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
What is the argument of a function in c?
What is difference between class and structure?
What are integer variable, floating-point variable and character variable?