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

Answer Posted / vikas kumar from agra

#include<stdio.h>
#include<conio.h>
void main()
{
long int num,i;
int d;
clrscr();
printf("\n enter number");
scanf("%ld",&n);
printf("\n the reverse of number %ld is ",num);
for(i=0;i>0;i=i\10)
{
d=i%10;
printf("%d",d);
}
getch();
}

Is This Answer Correct ?    39 Yes 83 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to establish connection with oracle database software from c language?

1904


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

2069


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

1680


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

2882


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions

2934


What is the purpose of type declarations?

866


FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above

857


What are the disadvantages of c language?

842


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

2552


What language is windows 1.0 written?

774


Differentiate between null and void pointers.

860


Is there anything like an ifdef for typedefs?

879


Discuss the function of conditional operator, size of operator and comma operator with examples.

876


Why is it usually a bad idea to use gets()? Suggest a workaround.

1336


What's the best way of making my program efficient?

822