- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Environmental Science
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to reverse a given number using C
#include <stdio.h>
int main() {
int num, rem, rev = 0;
printf("\nEnter any no to be reversed : ");
scanf("%d", &num);
while (num >= 1) {
rem = num % 10;
rev = rev * 10 + rem;
num = num / 10;
}
printf("\nReversed Number : %d", rev);
return (0);
}
Output :
Enter any no to be reversed : 123
Reversed Number : 321
- Related Questions & Answers
- How to reads customer number and power consumed and prints amount to be paid using C
- How to Solve Second Order Quadratic Equation Using C Program
- Write C Program to Find Largest Element in Array in C Programming
- Write C Program to Reversing an Array Elements in C Programming
- How to read the values of x, y and z and print the results expressions in one line using C Program
- How to Calculate Area of Equilatral Triangle using C Language
- Write C Program to Merge Two arrays in C Programming
- How to Calculate Area of Circle using C Programming
- How to find sum of two numbers using C Language
- How to Find Area of Scalene Triangle using C
- How to print hello world using C Language
- Recursive program to linearly search an element in a given array using C
- How to convert temperature from degree centigrade to Fahrenheit using C
- Write C Program to Find Factorial of Number Using Recursion
- Write a ‘C’ Program to compute the sum of all elements stored in an array using pointers
- Write C program to find Exponent Power Series
Advertisements
ads