C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
C# Program to reverse numberWe can reverse a number in C# using loop and arithmetic operators. In this program, we are getting number as input from the user and reversing that number. Let's see a simple C# example to reverse a given number. using System; public class ReverseExample { public static void Main(string[] args) { int n, reverse=0, rem; Console.Write("Enter a number: "); n= int.Parse(Console.ReadLine()); while(n!=0) { rem=n%10; reverse=reverse*10+rem; n/=10; } Console.Write("Reversed Number: "+reverse); } } Output: Enter a number: 234 Reversed Number: 432 |