Input three digits number and reverse it. Eg. 125 Output should be- Reversed Number is: 52
Answers
Answered by
0
Explanation:
x = Str(125)
y = str(x[::-1])
z = y[0:2]
print(z)
* Chech if doubt But answers is correct
MARK ME AS BRAINLY
Answered by
1
Question:-
Write a program to input a three digit number and reverse it.
Solution:-
Here is your program written in Java.
class Number
{
public static void main(int a)
{
int s=0;
for(;a!=10;a/=10)
s=s*10+a%10;
System.out.println("Reversed number is: "+s);
}
}
Similar questions