answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();

int r=0,d,m,n;

printf("Enter a value=");

scanf("%d",&n);

m=n;

do

{

d=m%10;

m=m/10;

r=(r*10)+d;

}

while(m!=0);

printf("%d is the reverse",r);

getch();

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How to write a program in python to print the reverse of a number?

In python, type the following into a document. NOTE: Sentences following a # symbol are comments, and are not necessary for the program to run. #!/usr/bin/python #This program takes a input from a user and reverses it. number = input("Type a number: ") #This takes input from a user. a = len(number) #This finds the length of the number reverse = "" #This sets the variable reverse to an empty string. for i in number: a = a-1 #The places in a string start from 0. The last value will be the length minus 1.reverse = reverse + number[a] #Makes the number's last digit the new string's first. print("The reverse of", number, "is", reverse + ".") #prints the resulting string. This program will take any sequence of characters and reverse them. The final value is a string, but if an integer is needed, one needs only to add the line reverse = int(reverse) above the print statement. However, this will stop the program from being able to reverse strings, as it is not possible to convert a string to an integer if it is not a number.


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 Write a program in 'c' language which accepts int numbers from the users print its reverse number x function which return value?

question clarity


C program to fine the largest of 10 given number?

first sort the ten numbers in descending order and print the first number. That will be the largest no


C plus plus program to print number patterns?

bghjg


C program to read an array and print its reverse number using pointers?

#include&lt;stdio.h&gt; void main() { int *p,n,s=0; printf("Enter Number :"); scanf("%d",&amp;n); for(p=&amp;n;*p&gt;0;p++) { s=s*10+*p%10; *p=*p/10; } printf("Reverse Number=%d",s); }


How do you solve this program wap to print sum of a digit of an inputed number?

wap to print all the arnstrong no. between 100&amp;1000


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


Which optionin print command is used to print the document from las to first?

In many print dialog boxes, the option to print a document from last to first is typically referred to as &quot;Reverse Order&quot; or &quot;Print in Reverse.&quot; This option allows you to print the pages starting from the last page and proceeding to the first page, which can be useful for organizing documents as they are printed. Make sure to check the specific settings in your print dialog, as terminology may vary by software.


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); } }


To write shell program to check the given number and its reverse are same?

echo "enter the number" if [ $# -ne 1 ] then echo "Usage: $0 number" echo " I will find reverse of given number" echo " For eg. $0 12321, I will print 12321" exit 1 fi n=$1 rev=0 sd=0 while [ $n -gt 0 ] do sd=`expr $n % 10` rev=`expr $rev \* 10 + $sd` n=`expr $n / 10` done echo "Reverse number is $rev"


Program to print the greatest number in unix?

There is no such thing as 'the greatest number'. Here is a program in unix to prove it: echo 'for (i=1; i&gt;=0; i= i*2) print i,"\n";' | bc if you want to actually see the output use it this way: echo 'for (i=1; i&gt;=0; i= i*2) print i,"\n";' | bc | less -S