Excellent Code
simply excellent ...
Pages
Home
Request for more
C++ : read a five digit number and separate the digit and print them separated by 3 spaces
#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);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment