InformáticaBásico1 respuestas

Escriba un programa que pida al usuario ingresar la altura y el ancho de un rectángulo y lo dibuje utilizando asteriscos?

Escriba un programa que pida al usuario ingresar la altura y el ancho de un rectángulo y lo dibuje utilizando asteriscos.

Pregunta de Informática · 1 respuesta · 6 votos · mejor respuesta de Angiefiorella7877

En resumen

Console. WriteLine("Longitud del rectangulo") ; int width = (int)Console. ReadLine() ; Console. WriteLine("Altitud del rectangulo") ; int height = (int)Console. ReadLine() ; for(int y = 0 ; y < height ; y + + ) { for(int x = 0 ; x < width ; x + + ) { Console.

Respuestas de la comunidad

Mejor respuesta

10

Console.

WriteLine("Longitud del rectangulo") ;

int width = (int)Console.

ReadLine() ;

Console.

WriteLine("Altitud del rectangulo") ;

int height = (int)Console.

ReadLine() ;

for(int y = 0 ; y < height ; y + + )

{

for(int x = 0 ; x < width ; x + + )

{

Console.

Write(" * ") ;

}

Console.

WriteLine("") ;

}

Console.

Read() ;

Preguntas frecuentes

Escriba un programa que pida al usuario ingresar la altura y el ancho de un rectángulo y lo dibuje utilizando asteriscos?

Console. WriteLine("Longitud del rectangulo") ; int width = (int)Console. ReadLine() ; Console. WriteLine("Altitud del rectangulo") ; int height = (int)Console.