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 pass by reference in functions?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
Explain how can you tell whether a program was compiled using c versus c++?
What are pointers? Why are they used?
What is a c token and types of c tokens?
What is the size of a union variable?
Explain the difference between getch() and getche() in c?
What is #define size in c?
Do you have any idea about the use of "auto" keyword?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
What are the basic data types associated with c?
Is null equal to 0 in sql?
What are the loops in c?
What is the best way to comment out a section of code that contains comments?
What is %d used for?