answersLogoWhite

0

C-Program on reversing a digit

Updated: 8/11/2023
User Avatar

Wiki User

15y ago

Best Answer

int RevNum( int num )

{

const int base = 10;

int result = 0;

do

{

result *= base;

result += num % base;

} while( num /= base);

return( result );

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

A single digit cannot be reversed.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C-Program on reversing a digit
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Does reversing the order of the digits of a two digit prime number always result in a prime number?

No, reversing the order of the digits of a two-digit prime number does not always result in a prime number.


Does reversing the order of thedigits of a 2 digit prime number always result in a prime number?

No. For example, reversing 23 gets 32.


You are a two digit-prime number the number formed by reversing you digits are also prime your ones digit is 4 less than your tens digit what number are you?

73


You are a 2-digit prime number The number formed by reversing your digits is also prime your ones digit is 4 less than your tens digit What number are you?

73 7-3 = 4 73 is prime and 37 is prime.


The sum of any two-digit number and the number formed by reversing the digits is always divisible by what?

The sum of any two-digit number and the number formed by reversing the digits is always divisible by 11.Why?The algebraic proof is as follows:(10x+y) + (10y+x) = 11x + 11y = 11(x+y)


Do you always get a prime number when you rivers a two digit prime number?

No, not always. When you reverse a two-digit prime number, the result may or may not be a prime number. It depends on the specific number you are reversing.


Does reversing the order of the digits of a 2 digit prime number always result in a prime number?

No because as for example 23 is a prime number but 32 is a composite number


Why the float is used in cprogram?

It's one of the built-in data-types, a float-type variable can hold a floating-point number.


How many reversing lights on a vw golf mk5?

There is one reversing light. There is one reversing light.


What is reversing number?

A reversing number is a number. Say 14. You reverse the numbers. Then the number will be 41. That is a reversing number.


The sum of the digits of a two digit number is 9 the number obtained by reversing the order of the digits of the gven numbers exceeds the given number by 27 find the given numbers?

3 and 6


What is cprogram code to insert a node in single link list?

Write Code to Insert a Node in a Single Linked List at any given Position.