Computer Science, asked by aditichauhan87, 1 year ago

write a program to swap two numbers

Answers

Answered by Anonymous
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 Anonymous
5

Heya My Dear lover

When I look in your eyes

I see myself

Being with you forever.

#Sourav+Addy

Similar questions