Get input into two variables and swap (interchange) values of variables. Write program
Answers
Answered by
1
Answer:
value of variables
Explanation:
okay thanks
Answered by
1
Answer:
#include <stdio.h>
int main()
{
int x, y, t;// x and y are the swapping variables and t is another variable
printf("Enter the value of X and Y\n");
scanf("%d%d", &x, &y);
printf("before swapping numbers: %d %d\n",x,y);
/*swapping*/
t = x;
x = y;
y = t;
printf("After swapping: %d %d",x,y);
return 0;
}
Hope it helps you :)☺
Similar questions