Computer Science, asked by galaxy15, 6 months ago

Program 19:- Write a program to reverse a four - digit number using % and // operators.

Answers

Answered by 0RPS0
4

Num=eval (input('Enter four-digit number: '))

print('Entered number is:' ,num)

r1=num%10

q1=num//10

r2=q1%10

q2=q1//10

r3=q2%10

q3=q2//10

q4=q3%10

print('Reverse of ', num,' is: ',r1, r2, r3, r4,)

*Output*

Enter four - digit number: 8763

Entered number is: 8763

Reversed of 8763 is: 3 6 7 8

Answered by galaxy24
0

Num=eval (input('Enter four-digit number: '))

Similar questions