Please login

Prime

Prepinsta Prime

Video courses for company/skill based Preparation

(Check all courses)
Get Prime Video
Prime

Prepinsta Prime

Purchase mock tests for company/skill building

(Check all mocks)
Get Prime mock

Problem 13

3 comments on “Problem 13”


  • Richik

    PYTHON 3:
    k=0
    i=0
    def rev(n):
    global k
    global i
    if n==0:
    return
    else:
    rev(n//10)
    k+=(n%10)*10**i
    i+=1
    rev(int(input()))
    print(k)


  • Harsha

    def reverse(n):
    str_n=str(n)
    if n<0:
    str_n=str_n[1:]
    str_n=str_n[::-1]
    str_n='-'+str_n
    else:
    str_n=str_n[::-1]
    return int(str_n)
    n=int(input())
    print(reverse(n))


  • avi gehlot

    #python code here
    number =int(input())
    reverse=0
    while number>0:
    remainder=number%10
    reverse=reverse*10+remainder
    number=number//10
    print(reverse)