C++ :: Menentukan Jumlah Hari Dalam Bulan Dan Tahun Tertentu

Home » Komputer » Pemrograman » C++ » C++ :: Menentukan Jumlah Hari Dalam Bulan Dan Tahun Tertentu
C++ 16 Comments

Script berikut akan menampilkan jumlah hari dalam bulan dan tahun tertentu sesuai dengan bulan dan tahun yang diminta.
Script ini menggunakan Array 1 Dimensi dan statemen if else.

//program jumlah hari
#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”;
}

16 thoughts on - C++ :: Menentukan Jumlah Hari Dalam Bulan Dan Tahun Tertentu

  • … [Trackback]

    […] Find More here|Find More|Read More Informations here|Here you can find 57368 more Informations|Infos on that Topic: blog.loksado.com/c-menentukan-jumlah-hari-dalam-bulan-dan-tahun-tertentu […]

  • … [Trackback]

    […] Find More on|Find More|Find More Infos here|There you will find 81198 more Infos|Infos on that Topic: blog.loksado.com/c-menentukan-jumlah-hari-dalam-bulan-dan-tahun-tertentu […]

  • … [Trackback]

    […] Read More on|Read More|Find More Infos here|Here you will find 84222 additional Infos|Informations on that Topic: blog.loksado.com/c-menentukan-jumlah-hari-dalam-bulan-dan-tahun-tertentu […]

  • … [Trackback]

    […] Find More on|Find More|Read More Infos here|There you will find 85140 additional Infos|Informations on that Topic: blog.loksado.com/c-menentukan-jumlah-hari-dalam-bulan-dan-tahun-tertentu […]

  • … [Trackback]

    […] Read More on|Read More|Find More Informations here|There you can find 44213 more Informations|Infos to that Topic: blog.loksado.com/c-menentukan-jumlah-hari-dalam-bulan-dan-tahun-tertentu […]

  • … [Trackback]

    […] Read More here|Read More|Read More Informations here|There you will find 74895 additional Informations|Informations on that Topic: blog.loksado.com/c-menentukan-jumlah-hari-dalam-bulan-dan-tahun-tertentu […]

  • … [Trackback]

    […] Find More here|Find More|Find More Infos here|Here you can find 8028 more Infos|Infos to that Topic: blog.loksado.com/c-menentukan-jumlah-hari-dalam-bulan-dan-tahun-tertentu […]

  • … [Trackback]

    […] Find More on|Find More|Read More Infos here|There you can find 74139 additional Infos|Informations on that Topic: blog.loksado.com/c-menentukan-jumlah-hari-dalam-bulan-dan-tahun-tertentu […]

  • … [Trackback]

    […] Read More here|Read More|Read More Informations here|Here you will find 6585 additional Informations|Informations to that Topic: blog.loksado.com/c-menentukan-jumlah-hari-dalam-bulan-dan-tahun-tertentu […]

  • … [Trackback]

    […] Read More here|Read More|Find More Infos here|There you will find 11284 more Infos|Informations to that Topic: blog.loksado.com/c-menentukan-jumlah-hari-dalam-bulan-dan-tahun-tertentu […]

  • … [Trackback]

    […] Read More here|Read More|Read More Infos here|There you can find 15105 more Infos|Informations to that Topic: blog.loksado.com/c-menentukan-jumlah-hari-dalam-bulan-dan-tahun-tertentu […]

  • … [Trackback]

    […] Find More here|Find More|Read More Informations here|There you can find 48070 additional Informations|Informations to that Topic: blog.loksado.com/c-menentukan-jumlah-hari-dalam-bulan-dan-tahun-tertentu […]

  • … [Trackback]

    […] Find More here|Find More|Read More Infos here|Here you can find 83704 more Infos|Infos on that Topic: blog.loksado.com/c-menentukan-jumlah-hari-dalam-bulan-dan-tahun-tertentu […]

LEAVE A COMMENT