Answers for "funciones en C#"

C#
0

funciones en C#

struct Cliente {
  public int codigo;
  public string apellido;
  public string nombre;
}
Posted by: Guest on January-02-2021
0

funciones en C#

void VerResultado() {
  Console.WriteLine("¡¡¡Ganador!!!");
}
Posted by: Guest on January-02-2021
0

funciones en C#

Cliente c1, c2, c3;
  c1.codigo = 200;
  c1.nombre = "Juanjo";
  c1.apellido = "Pedraza";

  c2.codigo = 125;
  c2.nombre = "Perico";
  c2.apellido = "Palotes";

  c3 = c1 + c2;
  //Aquí el compilador daría error porque no se pueden aplicar el operando al tipo.
}
Posted by: Guest on January-02-2021
0

funciones en C#

private static string GetText(string path, string filename)
{
     var reader = File.OpenText($"{AppendPathSeparator(path)}{filename}");
     var text = reader.ReadToEnd();
     return text;

     string AppendPathSeparator(string filepath)
     {
        return filepath.EndsWith(@"\") ? filepath : filepath + @"\";
     }
}
Posted by: Guest on January-02-2021
0

funciones en C#

#nullable enable
private static void Process(string?[] lines, string mark)
{
    foreach (var line in lines)
    {
        if (IsValid(line))
        {
            // Processing logic...
        }
    }

    bool IsValid([NotNullWhen(true)] string? line)
    {
        return !string.IsNullOrEmpty(line) && line.Length >= mark.Length;
    }
}
Posted by: Guest on January-02-2021
0

funciones en C#

double calculoNeto(double Pbruto, double Tasa = 21);
Posted by: Guest on January-02-2021
0

funciones en C#

<modifiers> <return-type> <method-name> <parameter-list>
Posted by: Guest on January-02-2021
0

funciones en C#

<modificador de acceso> <tipo de retorno> <Nombre de la función>( 
[parámetro 1, [parámetro 2]...]) 
{ 
    //Procesamientos 
    return <valor>; 
}
Posted by: Guest on January-03-2021
0

funciones en C#

public static double CalculoNETO (double Pbruto, double Tasa) { 
  return Pbruto * (1+(Tasa/100));
}
...
double PrecioBruto = 100;
double PrecioNeto;
PrecioNeto = TestEstructura.CalculoNETO(PrecioBruto, 5.5);
Console.WriteLine(PrecioNeto);
Posted by: Guest on January-02-2021
0

funciones en C#

double calculoNeto(double Pbruto, double Tasa = 21; String divisa);
Posted by: Guest on January-02-2021

C# Answers by Framework

Browse Popular Code Answers by Language