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
What is the use of a static variable in c?
Explain union. What are its advantages?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
What is a pointer on a pointer in c programming language?
What is void pointers in c?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
Explain the difference between malloc() and calloc() function?
What are header files? What are their uses?
What is 02d in c?
What is pass by value in c?
How macro execution is faster than function ?
What is a macro in c preprocessor?
What are the differences between new and malloc in C?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
write a program for the normal snake games find in most of the mobiles.