write a program to swap Two numbers without using temp variable.
Answer Posted / sree
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("Enter two numbers");
scanf("%d %d",&a &b);
a=a+b;
b=a-b;
a=a-b;
printf("The swapped values are:");
printf("a:%d",a);
printf("b:%d",b);
getch();
}
| Is This Answer Correct ? | 73 Yes | 24 No |
Post New Answer View All Answers
Write a program to print "hello world" without using a semicolon?
What is the purpose of the preprocessor directive error?
What does a pointer variable always consist of?
Can we increase size of array in c?
What is volatile variable in c with example?
i have a written test for microland please give me test pattern
What is meant by errors and debugging?
write a program to rearrange the array such way that all even elements should come first and next come odd
what do the 'c' and 'v' in argc and argv stand for?
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?
Explain how can I avoid the abort, retry, fail messages?
In c language can we compile a program without main() function?
What is the difference between printf and scanf in c?
Why doesnt the call scanf work?
What is unary operator?