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

How to delete a node from linked list w/o using collectons?

2387


Explain the red-black trees?

820


What is the meaning of ?

802


What is the difference between the local variable and global variable in c?

725


Write a program to check whether a number is prime or not using c?

800


Explain what are the standard predefined macros?

869


What are enumerated types?

849


What is the size of structure in c?

894


If null and 0 are equivalent as null pointer constants, which should I use?

813


What does dm mean sexually?

1040


What is data type long in c?

828


Explain what is the benefit of using enum to declare a constant?

814


Can you return null in c?

861


What is function prototype in c language?

808


What is FIFO?

1135