No products in the cart.

Write a program to reverse a …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

Write a program to reverse a number and to check whether the number is palindrome or not
  • 1 answers

Disha Agrawal 5 years, 11 months ago

#include <stdio.h> void main() { int num, temp, remainder, reverse = 0; printf("Enter an integer \n"); scanf("%d", &num); /* original number is stored at temp */ temp = num; while (num > 0) { remainder = num % 10; reverse = reverse * 10 + remainder; num /= 10; } printf("Given number is = %d\n", temp); printf("Its reverse is = %d\n", reverse); if (temp == reverse) printf("Number is a palindrome \n"); else printf("Number is not a palindrome \n"); getch(); }
http://mycbseguide.com/examin8/

Related Questions

What is alu
  • 1 answers
Define packages
  • 0 answers
Write a program for swapping two numbers
  • 1 answers
Write a program for swapping two numbers?
  • 0 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App