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 ? | 30 Yes | 26 No |
Post New Answer View All Answers
What is echo in c programming?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
How can I insert or delete a line (or record) in the middle of a file?
What is the translation phases used in c language?
List the different types of c tokens?
Is boolean a datatype in c?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
What is s in c?
Explain how can a program be made to print the name of a source file where an error occurs?
What are keywords in c with examples?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
What are the salient features of c languages?
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above
What is a void pointer in c?
Which is more efficient, a switch statement or an if else chain?