1. Course
  2. Data types A
  3. Double value

Double value


Last updated: 8/22/2020 Difficulty: Easy

Write a C# program that requests the width (x) and height (y) of a rectangle and calculate the perimeter, area and diagonal.

  • Perimeter= sum of the four sides.
  • Area= base x height.
  • Diagonal= Pythagorean theorem.

Input

4
6

Output

Perimeter: 20
Area: 24
Diagonal: 7.21110255092798

Solution

Data types A

5 / 8

Android App


Practice C# anywhere with the free app for Android devices.

Android App

Exercises C# by difficulty


Learn C# at your own pace, the exercises are ordered by difficulty.

Make a donation


Your donations support our work and contribute to the maintenance of the app.

Advertising