Table of Contents

Pseudocode From t

Swap Two Numbers

Create the program Swap Two Numbers in C Language
#include<conio.h>
#include<stdio.h>
void main()
{
int a,b,temp;
printf("Enter Value of a=");
scanf("%d", &a);
printf("\nEnter Value of b= ");
scanf("%d", &b);
temp = a;
a = b;
b = temp;
printf("\nafter swap a=%d b=%d",a,b);
getch();
}
Program Output

            Enter value of a= 5

            Enter value of b= 7

            after swap a=7,b=5