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

Answer Posted / balaji ganesh

#include<stdio.h>
#include<string.h>
void main()
{
char a[50];
int i,n;
clrscr();
printf("\n enter number:");
scanf("%s",a);
printf("reverse number is:");
for(i=strlen(a);i>=0;i--)
{
printf("%c",a[i]);
}
getch();
}

Is This Answer Correct ?    29 Yes 26 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the significance of an algorithm to C programming?

585


What are the advantages of using new operator as compared to the function malloc ()?

746


What are extern variables in c?

539


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

1891


What are pointers in C? Give an example where to illustrate their significance.

737






Why is c platform dependent?

609


What is page thrashing?

645


What is a built-in function in C?

782


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

718


What is #include stdio h and #include conio h?

591


What is meant by errors and debugging?

639


a c code by using memory allocation for add ,multiply of sprase matrixes

2290


How do you determine whether to use a stream function or a low-level function?

636


What is the difference between text files and binary files?

667


What are different types of pointers?

554