tglfeb09.cpp

Bookmark and Share
#include<iostream.h>

main ()

{

int t,h,p;

cout<<"Bulan Februari Tahun 2009";

cout<<"\nMasukkan tanggal: ";

cin>>t;

h=t%7;

p=t%5;

if (t<1||t>28)

cout<<"Error 327, salah memasukkan tanggal.";

else {if (0<t&&t<29)

cout<<"Hari: ";

if (h==1)

cout<<"Minggu";

else if (h==2)

cout<<"Senin";

else if (h==3)

cout<<"Selasa";

else if (h==4)

cout<<"Rabu";

else if (h==5)

cout<<"Kamis";

else if (h==6)

cout<<"Jumat";

else if (h==0)

cout<<"Sabtu";

if (p==1)

cout<<" kliwon";

else if (p==2)

cout<<" legi";

else if (p==3)

cout<<" pahing";

else if (p==4)

cout<<" pon";

else if (p==0)

cout<<" wage";}

}

{ 0 komentar... Views All / Send Comment! }

Posting Komentar

Powered By Blogger