/*Reverse a Number*/
#include<stdio.h>
#include<conio.h>
void main()
{
int number,reverse_number;
clrscr();
printf("Enter the Number you want to reverse:");
scanf("%d",&number);
/*we use while loop and '%' to seprate a number*/
printf("Reverse number is:");
while(number>0)
{
reverse_number=number%10;
number=number/10;//update number
printf("%d",reverse_number);
}
getch();
} |
basically this is a a my own blog to help ma students and friends with sharing useful information with the. information regarding C language code. .net applications, .net projects. general technical information. notes.
Sunday, 13 November 2011
If a five-digit number is input through the keyboard,write a program to reverse the number?
Labels:
C Programs
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment