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

Answer Posted / k.ashok kumar

BETTER CODE:


#include<stdio.h>
#include<conio.h>
void main()
{
int a;
clrscr();
printf("\n Enter a number : ");
scanf("%d",&a);
printf("\n Reverse number of %d is : ",a);
while(a)
{
printf("%d",a%10);
a/=10;
}
getch();
}

Is This Answer Correct ?    6 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of sizeof?

556


Should I learn data structures in c or python?

583


What are the difference between a free-standing and a hosted environment?

745


Explain main function in c?

626


What are the different types of C instructions?

678






What are the types of type qualifiers in c?

650


Difference between pass by reference and pass by value?

658


What functions are used in dynamic memory allocation in c?

597


Why is it important to memset a variable, immediately after allocating memory to it ?

1555


Which function in C can be used to append a string to another string?

647


What is the explanation for modular programming?

685


Why header file is used in c?

577


How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?

593


Is there any demerits of using pointer?

631


Difference between MAC vs. IP Addressing

641