Program 19:- Write a program to reverse a four - digit number using % and // operators.
Answers
Answered by
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
0
Num=eval (input('Enter four-digit number: '))
Similar questions
English,
2 months ago
Science,
2 months ago
Computer Science,
2 months ago
Social Sciences,
6 months ago
Chemistry,
11 months ago
English,
11 months ago
Science,
11 months ago