write a program to display reverse of a number using for
loop?
Answer Posted / jayesh jain
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i;
int rem;
clrscr();
printf("\n enter number");
scanf("%ld",&num);
printf("\n the reverse of number %ld is ",num);
for(i=0;num>0;i++)
{
rem=num%10;
num=num/10;
printf("%d",rem);
}
getch();
}
Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
Tell me is null always defined as 0(zero)?
What is a method in c?
What is mean by data types in c?
How can I read data from data files with particular formats?
p*=(++q)++*--p when p=q=1 while(q<=6)
If the size of int data type is two bytes, what is the range of signed int data type?
What does nil mean in c?
Where register variables are stored in c?
What is scope of variable in c?
Explain b+ tree?
Why pointers are used?
Explain void pointer?
Explain what is the difference between the expression '++a' and 'a++'?
What is the difference between array and pointer in c?
Explain the use of keyword 'register' with respect to variables.