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 are the types of type specifiers?
How can I read/write structures from/to data files?
What is the need of structure in c?
explain how do you use macro?
What are the types of operators in c?
When should structures be passed by values or by references?
What is pass by reference in c?
Explain how can a program be made to print the line number where an error occurs?
Explain about C function prototype?
What is a void pointer? When is a void pointer used?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
What is the use of a semicolon (;) at the end of every program statement?
Is swift based on c?
List the variables are used for writing doubly linked list program.
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.