Q19.Consider the following Python snippet. Assume that 2345 is passed as input to the code. Which of the following option is the correct output for the given input?
```
num = int(input("Enter a number"))
r_num = 1
while num != 0:
digit = num % 10
r_num = r_num * 10 + digit
num //= 10
print(r_num)
```
Save
Check
Details
Q19
16 Jul 2023
Q19.Consider the following Python snippet. Assume that 2345 is passed as input to the code. Which of the following option is the correct output for the given input?
```
num = int(input("Enter a number"))
r_num = 1
while num != 0:
digit = num % 10
r_num = r_num * 10 + digit
num //= 10
print(r_num)
```