Jan 14, 2012

Program Menentukan Golongan Usia

Now I will post how to make code c++  to determine the age groups, check this out!!

main ()
char nama[20];
int umr;
cout<<"Program Menentukan Usia"<<endl;
cout<<"Nama : ";cin>>nama;
cout<<"Umur : ";cin>>umr;
if (umr<3) cout<<"  Batita"<<endl;
if (umr>=3 && umr<5) cout<<"  Balita"<<endl;
if (umr>=5 && umr<12) cout<<"  Anak-anak"<<endl;
if (umr>=12 && umr<17) cout<<"  Remaja"<<endl;
if (umr>=17 && umr<25) cout<<"  Dewasa"<<endl;
if (umr>=25 && umr<55) cout<<"  Tua"<<endl;
if (umr>=55) cout<<"  Lansia"<<endl;

return (0);

Okay, that's the code.

Share on Facebook
Share on Twitter
Share on Google+
Tags :

Related : Program Menentukan Golongan Usia