Sunday, April 24, 2016

C program to swap two variable(Using 3rd variable)

#include <stdio.h>
#include <conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter the first number");
scanf("%d",&a);
printf("Enter the second number");
scanf("%d",&b);
c=a;
a=b;
b=c;
printf("The swapped numbers are \na=%d",a);
printf("\nb=%d",b);
getch();
}


That's it for now
Thank you for visiting

No comments:

Post a Comment