Help,pls. | SoloLearn: Learn to code for FREE!



You are writing a program to calculate the area of a rectangle. Currently it takes the the length and the height as inputs. Complete the given method to take them as arguments, then calculate and return the area. Sample Input 4 5 Sample Output 20 Code: using System; using System.Formats.Asn1; namespace площадь_прямоугольника { class Program { static void Main(string[] args) { int lenght = Convert.ToInt32(Console.ReadLine()); int height = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(Area(lenght,height)); } static int Area(int lenght, int height) { Console.WriteLine(length*height); return length*height; } } }


4/12/2021 8:04:40 PM

Артем Попов

2 Answers

New Answer


Remove; Console.WriteLine(lenght*height); From the Area method and just return the value. P.S. it is spelled length not lenght