C# Online Compiler
Example: C# Program to Find Area of Rectangle
C
C++
C#
Java
Python
PHP
main.cs
STDIN
Run
// C# Program to Find Area of Rectangle using System; public class W3CW { static public void Main (string[] args) { Console.WriteLine("Enter the length & width of the rectangle::\n"); float length=Convert.ToInt32(Console.ReadLine()); float width=Convert.ToInt32(Console.ReadLine()); // It will calculate the area of a rectangle float area = length * width; // It will print the final output Console.WriteLine("Area of the rectangle is: "+area+" units"); } }
9 8
Output
Clear
ADVERTISEMENTS