answersLogoWhite

0

/*Reverse the digits of a number,Gankidi*/

#include<stdio.h>

void main(void)

{

int num,sum=0,i,rem;

printf("Enter a number");

scanf("%d",&num);

while(num>0)

{

rem=num%10;

num=num/10;

sum=sum+(rem*10);

}

printf("the reverse number is %d",sum);

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How can you generate a palindrome from a given number?

You write the number and then follow it with the digits in reverse order.


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

To write a program in Python that reverses a number, you can convert the number to a string, reverse the string, and then convert it back to an integer. Here's a simple example: def reverse_number(num): return int(str(num)[::-1]) number = 12345 reversed_number = reverse_number(number) print(reversed_number) # Output: 54321 This function takes an integer input, reverses its digits, and returns the reversed number.


How do you Write a C program to reverse an Integer number.?

Reference:cprogramming-bd.com/c_page2.aspx# reverse number


Write a Shell program to find the sum of cube of individual digits of a number?

no thanks


How do you write a C program to reverse the 3 digits of a number using while loop?

unsigned reverse (unsigned num) { unsigned rev = 0; while (num) { rev *= 10; rev += num % 10; num /= 10; } return rev; }


How write a program to input any number and display digits which are absent in given number?

To write a program that inputs a number and displays the digits absent in it, you can follow these steps: Convert the input number into a set of its digits. Create a set of all possible digits (0-9). Subtract the set of digits from the complete set to find the missing ones. Display the missing digits. Here’s a simple example in Python: number = input(&quot;Enter a number: &quot;) present_digits = set(number) all_digits = set('0123456789') missing_digits = all_digits - present_digits print(&quot;Missing digits:&quot;, ''.join(missing_digits))


How do you write a program that outputs a given characters in reverse?

write the javascript code to display the reverse no. of given no. (e.g. 247 reverse of 742)


How to write A Java program to print number of digits in a given number?

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.


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 do you write a program in qbasic to input 64751315 to sum?

In QBASIC, you can write a simple program to input the number 64751315 and sum its digits as follows: DIM sum AS INTEGER sum = 0 INPUT &quot;Enter a number: &quot;; number FOR i = 1 TO LEN(number) sum = sum + VAL(MID$(number, i, 1)) NEXT PRINT &quot;The sum of the digits is &quot;; sum This program prompts the user to input a number, iterates through each digit, converts it to an integer, and adds it to the total sum, which is then printed out.


Write a program to find the number of digits in the number?

#include &lt;stdio.h&gt; int main(int argc, char **argv) { if (argc&lt;1) { printf("Usage: %s number\n",argv[0]); return -1; } int digits=1, i=atoi(argv[1]); while (i/=10) ++digits; printf("%d\n",digits); }


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

Trending Questions
Can one spouce be charged with fraud by use of the outher spouces name to obtain credit cards? What is 'Sei il mio orgoglio e la mia gioia' when translated from Italian to English? What does it cost to rent space on an antenna tower? What is Robert Edwin Peary wife name's? How do you check on a bankruptcy filing that isn't owned by you? What type of behavior types has a high concern for their own needs and a low concern for other needs? What is something that can go up quite easily but is harder to bring back down? What is the meaning of signature style? How much is a 16x20 Enstrom Grace picture with story on back and other information? What are the answers to studies weekly week 2? How do you properly lay shingles on a roof to ensure a durable and weather-resistant installation? What are the multiples of 7 between 130 and 200? You are part of a combat patrol in a foreign country. There are squad size insurgent forces operating in the area. What are key considerations associated with civil considerations factor of METT-TC? My husband is married to another woman living in another state and I need proof. How can you find out if he is married to two people at same time? Where can one go to buy an aerobed for kids? What should be perfect figure size of a girl who is 22years old and with 5ft 2inch height? By definition the pneumatic drill is powered by what? Was Elrond a good character in 'The Hobbit'? The sides of a solid figure is called a? Where are the most valuable minerals can be found in places that have been located?