Well, keep rearranging it until it works.
Code:#include <iostream> #include <stdlib.h> int main() { int year; std::cout << "Enter a year and I will determine if it's a leap year: " ; std::cin >> year ; int leap; int leap2; int leap3; leap = year % 4 ; leap2 = year % 100 ; leap3 = year % 400 ; if (leap2!=0 && leap == 0 || leap3==0) { std::cout << "It is a leap year."; std::cin.get(); std::cin.get(); } else { std::cout << "It is not a leap year."; std::cin.get(); std::cin.get(); } return 0; }