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

Answer Posted / k.ashok kumar

BETTER CODE:


#include<stdio.h>
#include<conio.h>
void main()
{
int a;
clrscr();
printf("\n Enter a number : ");
scanf("%d",&a);
printf("\n Reverse number of %d is : ",a);
while(a)
{
printf("%d",a%10);
a/=10;
}
getch();
}

Is This Answer Correct ?    6 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

802


Is using exit() the same as using return?

919


What is static and auto variables in c?

783


write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

15460


How can I split up a string into whitespace-separated fields?

797


What is union and structure in c?

849


What is volatile variable in c with example?

776


what is the difference between class and unio?

2095


in linking some of os executables are linking name some of them

1882


What is #include stdlib h?

849


What is the difference between typedef struct and struct?

828


How are variables declared in c?

832


What do you know about the use of bit field?

807


count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array

871


What does s c mean in text?

825