void main() { long n,rev=0,d; clrscr();//to clear the screen printf("Enter any number:"); scanf("%ld",&n); while(n!=0) { d=n%10; rev=(rev*10)+d; n=n/10; } printf("The reversed number is %ld",rev); getch();//to stop the screen }
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.