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
What is the use of sizeof?
Should I learn data structures in c or python?
What are the difference between a free-standing and a hosted environment?
Explain main function in c?
What are the different types of C instructions?
What are the types of type qualifiers in c?
Difference between pass by reference and pass by value?
What functions are used in dynamic memory allocation in c?
Why is it important to memset a variable, immediately after allocating memory to it ?
Which function in C can be used to append a string to another string?
What is the explanation for modular programming?
Why header file is used in c?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
Is there any demerits of using pointer?
Difference between MAC vs. IP Addressing