#include <stdio.h>
int main()
{
int a,b,c;
printf("Enter two numbers ");
scanf("%d%d", &a, &b );
printf("\nBefore swapping, a = %d and b = %d", a, b);
c = a;
a = b;
b = c;
printf("\nAfter swapping, a=%d and b=%d", a, b);
return 0;
}
int main()
{
int a,b,c;
printf("Enter two numbers ");
scanf("%d%d", &a, &b );
printf("\nBefore swapping, a = %d and b = %d", a, b);
c = a;
a = b;
b = c;
printf("\nAfter swapping, a=%d and b=%d", a, b);
return 0;
}
Enter two numbers 3 4 Before swapping, a = 3 and b = 4 After swapping, a=4 and b=3
Comments
Post a Comment