Program for Swapping 2 Numbers
#include<stdio.h>
main()
{
int a,b,temp;
clrscr();
printf("enter a,b values:");
scanf("%d%d",&a,&b);
temp = a;
a = b;
b = temp;
printf("after swaping a,b values:%d%d",a,b);
getch();
}
output :-
enter a,b values : 10 20
after swaping a,b values : 20 10
0 comments:
Post a Comment