A program to swap two variables without using third variable.

Publié le: 09 août 2019
sur la chaîne: Sunita Panthi
39
6

A program to swap two variables entered by the user without using third variable. Learn coading, keep going and increasing knowledge.

Here is the code:
void main()
{
int a,b;
printf("Enter the first number\t");
scanf("%d",&a);
printf("Enter the second number\t");
scanf("%d",&b);
printf("\nThe numbers before swapping are first=%d and second=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("\nThe numbers after swapping are first=%d and second=%d",a,b);
getch();
}


Sur cette page du site, vous pouvez voir la vidéo en ligne A program to swap two variables without using third variable. durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Sunita Panthi 09 août 2019, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 39 fois et il a aimé 6 téléspectateurs. Bon visionnage!