write a program to display reverse of a number using for
loop?
Answer Posted / narendra
It is simple.use this and it works
#include <stdio.h>
#include <conio.h>
int main()
{
int rem,num;
clrscr();
printf("Enter the number\n");
scanf("%d",&num);
for (num= num; num > 0; num = num/10)
{
rem = num % 10;
printf("%d",rem);
}
return 0;
}
| Is This Answer Correct ? | 14 Yes | 11 No |
Post New Answer View All Answers
Can you please explain the difference between malloc() and calloc() function?
Explain how can I read and write comma-delimited text?
What is a program?
Is null always defined as 0(zero)?
Why is c so popular?
What is pointer to pointer in c language?
Explain what is the best way to comment out a section of code that contains comments?
What is the heap?
How can I handle floating-point exceptions gracefully?
Where static variables are stored in memory in c?
What are types of functions?
What is a static variable in c?
What is the purpose of the preprocessor directive error?
What is the use of putchar function?
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.