Monday, 25 May 2020

C# Program to Get a Number and Display the Number with its Reverse
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Program
{
    class Program
    {
        static void Main(string[] args)
        {
            int num, reverse = 0;
            Console.WriteLine("Enter a Number : ");
            num = int.Parse(Console.ReadLine());
            while (num != 0)
            {
                reverse = reverse * 10;
                reverse = reverse + num % 10;
                num = num / 10;
            }
            Console.WriteLine("Reverse of Entered Number is : "+reverse);
            Console.ReadLine();

        }
    }
}


Posted By: pankaj_bhakre

No comments:

Post a Comment