This is the simple program which calculate the Area of a Rectangle.
In this program when the user will execute the program it will ask for Height and Width.
Then it will put the value into formula and give result after calculating.
ENJOY CODING!!!!
_________________________________________________________________________________
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Area_Of_Rectangle { class PostSlush { static void Main(string[] args) { int height, width, area; Console.Write("Enter height:\t"); height = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter width:\t"); width = Convert.ToInt32(Console.ReadLine()); area = height * width; // Formula here Console.WriteLine("\nArea of Rectangle is {0}", area); Console.ReadLine(); } } }
Output :
Tags:
csharp.net