top of page

INSTRUCCIONES if, else if y else

Código simple como ejemplo del uso de las instrucciones if, else if y else.

using System.IO;
using System;

  public string velocidadLimite(double velocidad)
        {
            if (velocidad<60)
            {
           
    return ("Baja velocidad");
            }
            else if (velocidad<80)
                {
               
return ("Velocidad elevada");
                }
            else
            {
             
  return "Exceso de velocidad";
            }            

        }

bottom of page