Write a Qbasic program to take the side of a square from the user as input and find the area and the perimeter of a square.
Answers
Answered by
1
Answer:
Java programming
import java.util.Scanner;
public class Square
{
public static void main(String args[])
{
int side, peri, area;
Scanner scan = new Scanner(System.in);
System.out.print("Enter Side Length of Square : ");
side = scan.nextInt();
area = side*side;
peri = 4*side;
System.out.print("Area = " +area);
System.out.print("\nPerimeter = " +peri);
}
}
Similar questions