Memisahkan Nilai Ratusan, Puluhan, Satuan (C++)

Belajar pemrograman

Contoh program untuk memisahkan bilangan 3digit angka dalam Ratusan, Puluhan & Satuan.

#include<iostream.h>

void Nilai_Integer()

{
int x,y,z,x1,y1,z1;

cout<<“masukkan 3 digit angka = “;
cin>>x;
cout<<endl;
x1=x/100;
y=x%100;
y1=y/10;
z=y%10;
z1=z/1;
cout<<endl;
cout<<x1<<” = Ratusan “<<endl;
cout<<y1<<” = Puluhan “<<endl;
cout<<z1<<” = Satuan “<<endl;
cout<<endl;
}
int main()   {
Nilai_Integer();

return 0;

}

TRIMAKASIH TELAH MENGUJUNGI BLOG SAYA. smoga bermanfaat.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: