Monday, 24 October 2011

Program C++ Looking for a leap year

Program  C++ Looking for a leap year. It's a leap year can you find in C + +? Leap year is the year is divisible by 4 or 400 but not divisible by 100. Well, of course, the above explanation, we know the algorithm search program making the leap year.

Use if statements to look for it. If it is divisible by 4, or is divisible by 400 and not divisible by 100, then the leap year. Now we will look for how many leap years between two years that entered. Use a statement for or looping for this one.

#include <iostream.h>
#include <conio.h>

int main()
 int awal, akhir, tahun;

 cout<<"Masukkan Tahun Awal : ";
 cout<<"Masukkan Tahun Akhir : ";

 cout<<"Tahun Kabisat Antara "<<awal<<" dan "<<akhir<<" adalah : ";
 for(tahun=awal; tahun<=akhir; tahun++)

No comments:

Post a Comment