all think all those are possible, we just need a variable to store the user input (cin).
The division operator is a forward slash (/
), %
is the modulo operator, which gives you the remainder of the division.
you can google for an explanation on the modulo operator if you need it
your code has several flaws, Firstly, you use division operator. Secondly, not all years which are divisible by 4 are leap years. For centuries (1500, 1600, 1700 and so forth) there is a special rule. Only if the century is divisible by 400 is it a leap year. so 1600 and 2000 are leap years, while 1700, 1800 en 1900 are not