Answer to Question #273674 in C# for Hilok

Question #273674

1. The side of the square is given. Find the perimeter.

1
Expert's answer
2021-11-30T18:18:20-0500
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;
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS