Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication4
- {
- class Program
- {
- static void Main(string[] args)
- {
- int i1, i2 = 0, i3, x = 0;
- Console.WriteLine("Enter a number:");
- i1 = int.Parse(Console.ReadLine());
- i3 = i1;
- while (i3 > 0)
- {
- i3 /=10;
- x++;
- }
- for (; x > 0; x--)
- {
- i3 = i1 % 10;
- i1 /= 10;
- i2 = i2 * 10 + i3;
- }
- Console.WriteLine(i2);
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment