Write a program in C to print swaping of two numbers
// swaping of two numbers
#include <stdio.h>
int main()
{
int a,b,temp;
printf("Enter the value of a and b\n");
scanf("%d %d", &a, &b);
printf("before Swaping \n a=%d\n b=%d\n", a,b);
temp=a;
a=b;
b=temp;
printf("after swapping \n a=%d\n b=%d\n", a,b);
return 0;
}
Comments
Post a Comment