write a program to display reverse of a number using for
loop?

Answer Posted / narendra

It is simple.use this and it works

#include <stdio.h>
#include <conio.h>

int main()
{
int rem,num;
clrscr();
printf("Enter the number\n");
scanf("%d",&num);
for (num= num; num > 0; num = num/10)
{

rem = num % 10;
printf("%d",rem);

}
return 0;
}

Is This Answer Correct ?    14 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the general description for loop statement and available loop types in c?

678


How can I handle floating-point exceptions gracefully?

621


Why is c faster?

582


What is the condition that is applied with ?: Operator?

654


What are pointers? Why are they used?

625






Write a program to swap two numbers without using a temporary variable?

599


What is the significance of c program algorithms?

674


What is the use of function overloading in C?

665


What is the use of a ‘’ character?

580


Is c language still used?

528


Can one function call another?

619


What is a buffer in c?

566


Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250

1495


What is the use of structure padding in c?

553


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

1580