Selamat datang di maiav3.blogspot.com => Blog "TANPO ASMO"

SCRIPT C++_JUMLAH HARI

Jumat, 18 Januari 20130 komentar


//Program Jumlah Hari
//created by maiaachiea

#include<iostream.h>
#include<conio.h>
void main()
{
int Jml_Hari[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
int Bulan, Tahun, J_Hari;
clrscr();

cout<<"Bulan ke [1...12] = "; cin>>Bulan;
cout<<"Tahun             = "; cin>>Tahun;
if (Bulan == 2)
{
if ((Tahun % 4 == 0) && (Tahun % 100 == 0))
{
J_Hari = 29;
cout<<"Tahun Kabisat"<<endl;
}
else
{
J_Hari = 28;
cout<<"Tahun Biasa"<<endl;
}
}
else
{
J_Hari = Jml_Hari[Bulan];
}
cout<<"Bulan ke-"<<Bulan; cout<<" Tahun "<<Tahun<<endl;
cout<<"Jumlah Hari ==> "<<J_Hari<<" hari";
}
Share this article :

Posting Komentar

 
Support : Maia Achiea Template
Copyright © 2011. .: ^_^ :. - All Rights Reserved
Proudly powered by Blogger