write a program to display reverse of a number using for
loop?

Answer Posted / vishnu

int main()
{
int num;
int i;
int a[10];
printf("enter the number \n");
scanf("%d",&num);

for(i =0;num;i++)
{
a[i]=num %10;
num= num/10;
printf("%d",a[i]);
}

getch();
}

Is This Answer Correct ?    29 Yes 21 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pass by reference in functions?

314


What is hashing in c language?

603


Explain what math functions are available for integers? For floating point?

602


Why is c called c not d or e?

600


we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

798






Explain how are 16- and 32-bit numbers stored?

773


What is the difference between malloc() and calloc()?

609


What are the uses of a pointer?

669


How is a pointer variable declared?

583


What is "Hungarian Notation"?

630


How pointer is different from array?

569


Tell me when would you use a pointer to a function?

594


What is static volatile in c?

565


Do you have any idea about the use of "auto" keyword?

656


Write a program with dynamically allocation of variable.

597