C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Program to find the area of the square
Area of the square is the amount of space occupied by a square. Square refers to a plane figure with four equal straight sides and four right angles. Formulaarea = width � height Area of square will be calculated as : area = side2 since width = height; Algorithm
ComplexityO(1) SolutionC Program#include Output: Area of the square=169 PHP Program
<?php
$s=13;
$area_square=$s*$s;
echo "Area of the square=";
echo $area_square;
?>
Output: Area of the square=169 Java Program
public class shpere{
public static void main(String args[])
{
int s=13;
int area_square=s*s;
System.out.println("Area of the square="+area_square);
}
}
Output: Area of the square=169 C# Program
using System;
public class Program
{
public static void Main()
{
int s=13;
int area_square=s*s;
Console.WriteLine("Area of the square="+area_square);
}
}
Output: Area of the square=169 Python Program
s=13
area_square=s*s
print("Area of the square="+str(area_square))
Output: Area of the square=169
Next Topic#
|