Sie sind auf Seite 1von 1

Write a program that will inputs the five digit number, separate the

number into its individual digits and print the digits separated from one
another by three spaces each(Hint: Use the integer division and
modulus operators)
============================================
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
long int no,first,second,third,fourth,fifth;

cout<<"Enter the Five Digit no = ";


cin>>no;

first=no/10000;
no=no%10000;
second=no/1000;
no=no%1000;
third=no/100;
no=no%100;
fourth=no/10;
no=no%10;
fifth=no;

cout<<"\n==================================
============================================
="<<"\n\n\n";

cout<<"First Digit is = "<<first<<"\n\n";


cout<<"Second Digit is = "<<second<<"\n\n";
cout<<"Third Digit is = "<<third<<"\n\n";
cout<<"Fourth Digit is = "<<fourth<<"\n\n";
cout<<"Fifth Digit is = "<<fifth<<"\n\n\n";

cout<<"====================================
============================================"
;
getch();
}

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006

Das könnte Ihnen auch gefallen