1. The side of the square is given. Find the perimeter.
using System;
namespace Test
{
class PerimeterTest
{
static int Main()
{
int side;
Console.Write("Enter the side of the square: ");
string line = Console.ReadLine();
if(!int.TryParse(line, out side))
{
Console.WriteLine("Bad input");
return 1;
}
Console.WriteLine("The perimeter is {0}", 4 * side);
return 0;
}
}
}
Comments
Leave a comment