write a program to display reverse of a number using for
loop?
Answer Posted / hema
int main()
{
int a = 234;
printf("\n");
while( a != 0)
{
printf("%d",a%10);
a /= 10;
}
return 0;
}
______________________________________________________
use below program if you want to store value in another
variable
______________________________________________________
int main()
{
int a = 234;
int b = 0;
printf("\n");
while( a != 0 )
{
b = b *10 + (a%/10);
a /= 10;
}
printf("\n values in revers order= %d \n",b);
return 0;
}
Is This Answer Correct ? | 22 Yes | 11 No |
Post New Answer View All Answers
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
Explain can you assign a different address to an array tag?
What is an auto variable in c?
a c code by using memory allocation for add ,multiply of sprase matrixes
What is the difference between a string and an array?
What is difference between stdio h and conio h?
c language interview questions & answer
How do you redirect a standard stream?
Did c have any year 2000 problems?
please explain every phase in the "SDLC" in the dotnet.
How will you write a code for accessing the length of an array without assigning it to another variable?
Write a program of advanced Fibonacci series.
What are multidimensional arrays?
What is the mean of function?
What is function prototype in c language?