This code should make a multiplication table if the area is even, but the table do not work, where is the mistake ?
{ class Program { static void Main(string[] args) { int lado, area; float apotema; string texto;
Console.Write("Ingrese valor del lado: "); texto = Console.ReadLine(); lado = Int32.Parse(texto); Console.Write("Ingrese valor del apotema para calcular perimetro: "); apotema = Convert.ToSingle(Console.ReadLine()); area = lado * 5; Console.WriteLine("\nResultado area: " + area); Console.WriteLine("Resultado de perimetro: " + (area * apotema) / 2); if ((area % 2) == 0) { for (area = 0; area <= 10; area++) { Console.WriteLine("\nTabla de multiplicar: " + area + "x" + area + "=" + (area * area)); } } else { Console.WriteLine("\nEl area no es par no se muestra tabla"); } Console.WriteLine("\nPresione cualquier tecla para finalizar"); Console.ReadLine(); } }
}
https://stackoverflow.com/questions/66792480/how-make-multilpication-table-with-even-number March 25, 2021 at 11:06AM
没有评论:
发表评论