Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Ej6
- {
- class Program
- {
- static void Main(string[] args)
- {
- int año,res400,res100,res4;
- Console.WriteLine("Ingrese el año");
- año = int.Parse(Console.ReadLine());
- res400 = año % 400;
- res100 = año % 100;
- res4 = año % 4;
- if (res100 == 0 && res400 != 0)
- {
- Console.WriteLine("El año {0} no es bisiesto", año);
- }
- else
- {
- if (res400 == 0)
- Console.WriteLine("El año {0} es bisiesto", año);
- else
- {
- if (res4 == 0)
- Console.WriteLine("El año {0} es bisiesto", año);
- else
- Console.WriteLine("El año {0} no es bisiesto", año);
- }
- }
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment