Gourav n=int(input()) res=0 temp=n lenn=0 while(temp!=0): lenn+=1 temp=temp//10 for i in range(lenn): res=res*(10)+n%10 n=n//10 print(res) Log in to Reply
Sunny n=int(input()) rev=[] for i in str(n): rev.append(int(i)) reverse_final=rev[::-1] for i in range(len(reverse_final)): print(reverse_final[i],end=””) Log in to Reply
Raman // Online C compiler to run C program online #include int main() { int n,rem,c=0,i=0; int a[20]; scanf(“%d”,&n); while(n>0){ rem=n%10; a[i]=rem; n=n/10; i++; c++; } for(i=0;i<c;i++){ printf("%d",a[i]); } return 0; } Log in to Reply
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) Log in to Reply
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)) Log in to Reply
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) Log in to Reply
n=int(input())
res=0
temp=n
lenn=0
while(temp!=0):
lenn+=1
temp=temp//10
for i in range(lenn):
res=res*(10)+n%10
n=n//10
print(res)
Python:
num=str(input())
print(num[::-1]
#PYTHON
n=int(input())
c=0
while n!=0:
a1=n%10
c=c*10+a1
n=n//10
print(c)
n=int(input())
rev=[]
for i in str(n):
rev.append(int(i))
reverse_final=rev[::-1]
for i in range(len(reverse_final)):
print(reverse_final[i],end=””)
// Online C compiler to run C program online
#include
int main() {
int n,rem,c=0,i=0;
int a[20];
scanf(“%d”,&n);
while(n>0){
rem=n%10;
a[i]=rem;
n=n/10;
i++;
c++;
}
for(i=0;i<c;i++){
printf("%d",a[i]);
}
return 0;
}
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)
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))
#python code here
number =int(input())
reverse=0
while number>0:
remainder=number%10
reverse=reverse*10+remainder
number=number//10
print(reverse)
#PYTHON
n= input()
print(reversed(n))