satriafu5710

Menentukan Tahun Kabisat C++

Mar 5th, 2021
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.  
  7.     int tahun;
  8.  
  9.     cout << "\t Menentukan Tahun Kabisat \n\n";
  10.  
  11.     cout << " Masukkan Tahun : ";
  12.     cin >> tahun;
  13.  
  14.     if (tahun % 4 == 0 && tahun % 100 != 0 || tahun % 400 == 0)
  15.     {
  16.  
  17.         cout << "\n Ini Tahun Kabisat";
  18.     }
  19.  
  20.     else
  21.     {
  22.  
  23.         cout << "\n Ini Bukan Tahun Kabisat";
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment