using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Perimeter
{
Class Program
{
static void main(string[] args)
{
double lR, lS, bR;
double PS, PR;
Console.WriteLine("Input length of square and Rectangle.");
lS = Convert.ToDouble(Console.ReadLine());
lR = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Input breadth of Rectangle");
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Perimeter
{
Class Program
{
static void main(string[] args)
{
double lR, lS, bR;
double PS, PR;
Console.WriteLine("Input length of square and Rectangle.");
lS = Convert.ToDouble(Console.ReadLine());
lR = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Input breadth of Rectangle");
bR = Convert.ToDouble(Console.ReadLine());
PS = 4*lS;
PR = 2*(lR + BR);
Console.WriteLine("The perimeter of a square is: {0}", PS );
Console.WriteLine("The perimeter of the rectagle is: {0}", PR);
Console.ReadLine();
}
}
}
PS = 4*lS;
PR = 2*(lR + BR);
Console.WriteLine("The perimeter of a square is: {0}", PS );
Console.WriteLine("The perimeter of the rectagle is: {0}", PR);
Console.ReadLine();
}
}
}
OUTPUT:
Input length of square and rectangle:
5
6
Input breadth of rectangle: 7
The perimeter of a square is: 20
The perimeter of the Rectangle is: 26
Input length of square and rectangle:
5
6
Input breadth of rectangle: 7
The perimeter of a square is: 20
The perimeter of the Rectangle is: 26
Comments
Post a Comment