The program must accept two integers X and Y as the input. The program must
interchange only the unit digits of X and Y and print the modified X and Y as the output.
Example Input/Output 1:
Input:
234 456
Output:
236 454
Example Input/Output 2:
Input:
234 679
Output
239 674
can any one know how to solve this problem in c
Answers
Given : The program must accept two integers X and Y as the input.
To Find : The program must interchange only the unit digits of X and Y
print the modified X and Y as the output.
Solution:
Algorithm :
START
INT X , Y
INT RX , RY
RX = X % 10
RY = Y % 10
X = X - RX + RY
Y = Y - RY + RX
Print X , Y
END
Learn More:
How do I write an algorithm that multiply the age of a person by its ...
https://brainly.in/question/9522755
Write a a algorithm for a program that adds two digits numbers ...
brainly.in/question/14599411
write a program to sum the given sequences 1^2+3^2+5^2+n^2 ...
https://brainly.in/question/17500988
Answer:
#include <stdio.h>
int main()
{
int x,y,rx,ry;
scanf("%d %d",&x,&y);
rx=x%10;
ry=y%10;
x=x-rx+ry;
y=y-ry+rx;
printf("%d %d",x,y);
printf("\n");
}
Step-by-step explanation: