Created
November 8, 2015 18:00
-
-
Save nalin-adh/c3b86ec3c23ad2f6a5f7 to your computer and use it in GitHub Desktop.
A C++ program that reads a five digit number and separate the digit.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<conio.h> | |
using namespace std; | |
int main() | |
{ | |
int n,i,m; | |
start: | |
cout<<"Enter a five digit number : "; | |
cin>>n; | |
if(n>99999) | |
goto start; | |
for(i=0;i<5;i++) | |
{ | |
m=n%10; | |
n=n/10; | |
cout<<n<<" "; | |
} | |
getch(); | |
return(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment