write a program to swap Two numbers without using temp variable.
Answer Posted / romeld
#include<stdio.h>
main()
{
int a,b;
printf("enter the value of a and b\n");
scanf("%d%d",&a,&b);
printf("before swapping\na=%d\nb=%d\n",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("after swapping\na=%d\nb=%d\n",a,b);
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is #define in c?
What is the difference between procedural and functional programming?
What is time null in c?
What are pointers? Why are they used?
How can you find the day of the week given the date?
What is the use of c language in real life?
Why void main is used in c?
How to define structures? ·
Can you please compare array with pointer?
List the difference between a While & Do While loops?
#include
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
Is return a keyword in c?
What are identifiers in c?
What is #include stdlib h?