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
How are 16- and 32-bit numbers stored?
If errno contains a nonzero number, is there an error?
Write the Program to reverse a string using pointers.
Explain what is a 'locale'?
Is c still used?
which type of aspect you want from the student.
What is 1d array in c?
How can I dynamically allocate arrays?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
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?
What is the difference between array_name and &array_name?
What is the process to create increment and decrement stamen in c?
What are the types of arrays in c?
What are the advantages and disadvantages of a heap?
Why c is faster than c++?