0

How to reverse a number using pointer

pointers

23rd Mar 2018, 11:24 AM
Akash Ananth
3 ответов
+ 1
consider giving an upvote?
9th Apr 2018, 11:48 AM
Sahil Saluja
Sahil Saluja - avatar
0
\* C Program to to reverse a number using pointer *\ # include < stdio.h > int  main( ) { int  num, rem, rev=0 ; int  *pn, *pr ; printf(" Enter the number : ") ; scanf("%f ",& num) ; pn = & num ; pr = & rev ; do { rem = ( *pn ) % 10 ; *pr = ( *pr * 10 ) + rem ; *pn = ( *pn ) / 10 ; } while(  *pn > 0); printf("\n Reverse of Number is : %d ",*pr) ; return ( 0 ); }
9th Apr 2018, 11:44 AM
Sahil Saluja
Sahil Saluja - avatar
0
wahh
9th Apr 2018, 11:47 AM
Akash Ananth