Palindrome

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Palindrome as PDF for free.

More details

  • Words: 104
  • Pages: 1
1. Write a program to check whether a number is palindrome or not in C#. using System; using System.Collections.Generic; using System.Text; namespace LABPROGRAMS { class PALINDROME1 { public static void Main(string[] args) { int n, rev = 0, rem, p; Console.WriteLine("PROGRAM TO CHECK GIVEN INPUT NO IS PALINDROME OR NOT"); Console.WriteLine("\n\nEnter n value"); n = int.Parse(Console.ReadLine()); p = n; while (n > 0) { rem = n % 10; n = n / 10; rev = (rev * 10) + rem; } if (p == rev) Console.WriteLine("The value {0} is palindrome", rev); else Console.WriteLine("The value {0} is not palindrome", rev); Console.ReadLine(); } } }

Related Documents

Palindrome
June 2020 9
Palindrome
May 2020 6
Palindrome Poem
June 2020 9
Longest Palindrome
November 2019 9