Reverse numbers | Sololearn: Learn to code for FREE!

+1

Reverse numbers

how to reverse numbers in C program.....using function #include<stdio.h> int numbers(int); int main () { int n; printf("Enter Value Of n"); scanf("%d",&n); printf("reverse of enteres values %d",numbers(n)); } int numbers(int n ){ int reverse; while(n!=0){ reverse=reverse *10; reverse= reverse +n%10; n=n/10; return 0; } }

c

5/13/2018 11:29:08 AM

Jordan

3 Answers

New Answer

+3

https://code.sololearn.com/cgyEqMF12aNt/?ref=app

+1

initialize reverse=0 in function close while loop before return 0 statement. return value of reverse to main() return reverse;

0

yes thanks there is one more question cal you help about that?