Advertisement
Primitiv0

Days Of The Week

Sep 10th, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.32 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace DiasDeLaSemana
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int dia;
  14.             string linea;
  15.             dia = 0;
  16.             Console.Write("Ingrese un número del 1 al 7: ");
  17.             linea = Console.ReadLine();
  18.             dia = int.Parse(linea);
  19.             if (dia == 1)
  20.             {
  21.               Console.Write("Es Lunes");
  22.             }
  23.             else if (dia == 2)
  24.             {
  25.               Console.Write("Es Martes");
  26.             }
  27.             else if (dia == 3)
  28.             {
  29.               Console.Write("Es Miécoles");
  30.             }
  31.             else if (dia == 4)
  32.             {
  33.               Console.Write("Es Jueves");
  34.             }
  35.             else if (dia == 5)
  36.             {
  37.               Console.Write("Es Viernes");
  38.             }
  39.             else if (dia == 6)
  40.             {
  41.               Console.Write("Es Sábado");
  42.             }
  43.             else if (dia == 7)
  44.             {
  45.               Console.Write("Es Domingo");
  46.             }
  47.             else  
  48.             {
  49.               Console.Write("El número ingresado no es correcto");
  50.             }
  51.             Console.ReadKey();
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement