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
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
What is the purpose of main( ) in c language?
What does typedef struct mean?
What is the difference between a function and a method in c?
Write a function that will take in a phone number and output all possible alphabetical combinations
What is "Duff's Device"?
What is FIFO?
What is the purpose of ftell?
What is sizeof in c?
How is = symbol different from == symbol in c programming?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
What is the purpose of scanf() and printf() functions?
Why header files are used?
What is build process in c?
Explain what is a const pointer?