Think More And Get More
int n = 1234567; int left = n; int rev = 0; while(left>0) { r = left % 10; rev = rev * 10 + r; left = left / 10; } Console.WriteLine(rev);
No comments:
Post a Comment