Reverse numbers | Sololearn: Learn to code for FREE!


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; } }


5/13/2018 11:29:08 AM


3 Answers

New Answer



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


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