answersLogoWhite

0

Ex for reverse five digit number in c program?

Updated: 8/17/2019
User Avatar

Selvendran

Lvl 1
14y ago

Best Answer

#include<stdio.h>

#include<conio.h>

void main()

{

long int reverse(long int n);

clrscr();

printf("%ld",reverse(12345));

getch();

}

long int reverse(long int n)

{

long int r,rev=0;

while(n>0)

{

r=n%10;

rev=rev*10+r;

n=n/10;

}

return rev;

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Ex for reverse five digit number in c program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you find a five digit number which is four times its reverse?

87912 = 4 x 21978


What 5 digit number when multiplied by 4 yields the number the same five digits in reverse order?

The number is 21978. 21978 when multiplied by 4 which gives the result 87912 which is in reverse order.


What is a five digit number?

A five digit number is a number consisting of five digits. eg. 12345 54321 98765


What is the smallest five digit number having three digit?

All five digit numbers have three digits. The smallest five digit whole number is 10,000


What is the largest five-digit prime number?

The largest five-digit prime number is 99,991.


Which is the five digit odd number?

There are 45000 such numbers. None of them can be considered "the" five digit odd number.


The sum of digits of a two-digit number if five Find the number if the ten's digit is five more than the one's digit?

50


What is Geico's five digit insurance code number?

GEICO insurance company five digit code number


Is the product of a four digit and a one digit number always a five digit?

no


What is the smallest five digit number that can be rounded to 60000?

51111 is the smallest five digit number that can be rounded to 60000


If a five digit number is input through the keyboard write a program to calculate the sum of its digits?

If a five-digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits. For example if the number that is input is 12391 then the output should be displayed as 23402. //Author::Mudasir Yaqoob..... #include&lt;stdio.h&gt; #include&lt;conio.h&gt; int main() { long number,t; int i=0; long temp[5]; printf("Enter the five digit number:\n\n"); scanf("%ld",&amp;number); while(i&lt;=4) { t=number%10+1; temp[i]=t; number=number/10; i++; } printf("Reverse number\n\n\n\n"); for(i=4;i&gt;=0;i--) { printf("%ld",temp[i]); } getch(); }


What is the least number of digits there can be in the quotient when you divide a five number digit number by a one digit number?

4