how to find out the reverse number of a digit if it is
input through the keyboard?

Answer Posted / amrit

int main()
{
int a = 5678;
int temp=0,rev;

while((a%10)!=0)
{
rev =a%10;
a=a/10;
temp= temp*10+ rev;
}
return 0;
}

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How are 16- and 32-bit numbers stored?

721


If errno contains a nonzero number, is there an error?

801


Write the Program to reverse a string using pointers.

615


Explain what is a 'locale'?

583


Is c still used?

602






which type of aspect you want from the student.

1701


What is 1d array in c?

598


How can I dynamically allocate arrays?

590


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

650


A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?

1511


What is the difference between array_name and &array_name?

776


What is the process to create increment and decrement stamen in c?

586


What are the types of arrays in c?

621


What are the advantages and disadvantages of a heap?

706


Why c is faster than c++?

629