Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Write a program, which calculates a rectangle’s area, based on its width and height. The width and height come as floating point numbers on the console, formatted to the 2nd character after the decimal point.
- using System;
- namespace _02._Rectangle_Area
- {
- class RectangleArea
- {
- static void Main(string[] args)
- {
- double width = double.Parse(Console.ReadLine());
- double hieght = double.Parse(Console.ReadLine());
- double area = width * hieght;
- Console.WriteLine($"{area:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment