Skip to content

Instantly share code, notes, and snippets.

@nalin-adh
Created November 8, 2015 18:00
Show Gist options
  • Save nalin-adh/c3b86ec3c23ad2f6a5f7 to your computer and use it in GitHub Desktop.
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.
#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