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
what is the structure pointer?
Can we add pointers together?
What does %p mean?
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.
Write a program which returns the first non repetitive character in the string?
What are runtime error?
What is ponter?
What does a function declared as pascal do differently?
Where does the name "C" come from, anyway?
Why pointers are used in c?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
What are the 5 data types?
formula to convert 2500mmh2o into m3/hr
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
How can I implement sets or arrays of bits?