answersLogoWhite

0

#include<conio.h>

#include<stdio.h>

void main()

{

int d,m,r=0;

clrscr();

printf("\n Enter the value for m ");

scanf("%d",&m);

do

{

d=m%10;

m/=10;

r=(r*10)+d;

}while(m!=0);

getch();

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Design an algorithm to find a reverse of number?

An example of an algorithm that will reverse a number is written as such, digit reverse(num), while (num&gt;0) then, digit =num%10. This particular algorithm divides a number by 10 until the original number from the LSD is found.


How to Reverse a hexadecimal number using bitwise?

main() { int num=0xABCD; printf("%x\n",num); int rev=0x0; int digit=0x0; while(num!=0x0) { digit=num%0x10; rev = rev*0x10 +digit; num=num/0x10; } printf("%x\n",rev); }


Program to find reverse of given number using pointers?

#include #include void main() { int rev num=0; while(num&gt;0) { rev num=rev num*10+num%10; num=num%10; } return rev_num; } int main(); { int num=4562; printf("reverse of number is%d",reverse digit(num)); getch(); return o; }


Program for print reverse string of given number in java?

public class StringReverseExample { public static void main(String[] args) { int num=1001; int n=num, rev; while(num!=0) { int d=num%10; rev= (rev*10)+d; num=num/10; } System.uot.println(rev); } }


How do you Write a program that determines the number of occurrences of each digit in a given integer n?

there could be a part in it like this: int num, digit; int count [10]; do { digit = num%10; num != 10; ++count[digit]; } while (num);


What is the program for palindrome numbers from 500 to 100?

#include&lt;iostream&gt; // forward declarations... unsigned reverse (unsigned, const unsigned base = 10); bool is_palindrome (const unsigned); // the program... int main (void) { const unsigned max {500}; const unsigned min {100}; std::cout &lt;&lt; "Palindromes from " &lt;&lt; max &lt;&lt; " to " &lt;&lt; min &lt;&lt; std::endl; for (unsigned num {max}; num&gt;=min; --num) { if (is_palindrome (num)) { std::cout &lt;&lt; num &lt;&lt; std::endl; } } } // Returns the reverse of a number using the given base (default: base 10) // Note: trailing zeroes do not become leading zeroes so reverse (100) returns 1 not 001. // However, the reverse of 0 is obviously 0. unsigned reverse (unsigned num, const unsigned base /* = 10 */) { unsigned rev {}; // zero-initialised while (num) { rev *= base; rev += num % base; num /= base; } return rev; } // If the reverse of a number is the same number, that number is a palindrome. // All single-digit numbers are palindromes, including 0. bool is_palindrome (const unsigned num) { return num == reverse (num) ; }


How do you write a c program that reads a six digit integer and prints the sum of its six digits?

int sum_digits (int num) { int sum; sum =0; while (num) { sum += num % 10; num /= 10; } return sum; } Example usage: int main (void) { int i; printf ("Input a 6-digit number: "); scanf ("%6d", &amp;i); printf ("The sum of the digits in %d is: %d\n", i, sum_digits (i)); return 0; }


How you write a program in c plus plus to print plaindromic numbers from 1 to n?

To check if a number is a palindrome, reverse the number and see if it is equal to the original number. If so, the number is a palindrome, otherwise it is not. To reverse a number, use the following function: int reverse(int num, int base=10) { int reverse=0; while( num ) { reverse*=base; reverse+=num%base; num/=base; } return(reverse); }


How do you find the complement of numbers in java script?

function complement(num, base){ var result = 0, column = 0; if(base &lt; 2) return null; while(num &gt; 0){ digit = num % base;comp = base - 1 - digit;result += comp * Math.pow(base, column);column++;num -= digit;num /= base;} return result; }


Which is smallest three digit num?

100.


In c language codes for find out reverse of any number?

//program to print the reverse of a number within 'int' range//#include#includevoid main(){int num,rem,sum=0;printf("\n Enter a number : ");scanf("%d",&num);printf("\n\n Reverse is : );while(num>0){if(num


Write a C program to reverse the digits of a number?

/*Reverse the digits of a number,Gankidi*/ #include&lt;stdio.h&gt; void main(void) { int num,sum=0,i,rem; printf("Enter a number"); scanf("%d",&amp;num); while(num&gt;0) { rem=num%10; num=num/10; sum=sum+(rem*10); } printf("the reverse number is %d",sum); }