write a program to swap Two numbers without using temp variable.
Answer Posted / guest
# include "stdio.h"
main()
{
int a,b;
printf("enter two numbers for swaping");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("a is %d",a);
printf("b is %d",b);
} output:- takea,b value is 2,3 and give answers is3,2
| Is This Answer Correct ? | 243 Yes | 58 No |
Post New Answer View All Answers
Here is a good puzzle: how do you write a program which produces its own source code as output?
How can a number be converted to a string?
What are the different types of control structures?
What is #include stdlib h?
What is the concatenation operator?
swap 2 numbers without using third variable?
Explain what are reserved words?
diff between exptected result and requirement?
why programs in c are running with out #include
Can an array be an Ivalue?
Is this program statement valid? INT = 10.50;
What is the use of a conditional inclusion statement in C?
Can we access the array using a pointer in c language?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
Explain how can you check to see whether a symbol is defined?