write a program to swap two numbers
Answers
Answered by
5
using third variable
#include<studio.h>
main()
{
int a,b,temp=0;
printf("enter two number");
scanf("%d,%d",&a&b);
printf("enter number before swaping,"a,b);
a=temp;
temp=b;
b=a;
printf("enter number after swapping, "b,a);
}
logic
taken three variable a,b and temp
temp it is the temprory variable taken to store the value and temp=0 is taken to avoid any garbage value
a And b are the two number which is swap
Answered by
5
Heya My Dear lover
When I look in your eyes
I see myself
Being with you forever.
#Sourav+Addy
Similar questions
Computer Science,
6 months ago
English,
6 months ago
English,
6 months ago
English,
1 year ago
Math,
1 year ago