Computer Science, asked by MasterQuestioner, 1 year ago

Write a program using float type variables to
find the area and perimeter of a square whose
side is 12cm

Answers

Answered by duragpalsingh
10

Hey there!

Program using float type variables to  find the area and perimeter of a square whose  side is 12 cm.

class Question

{     static void main()  

  {         float s=12,a;    

    a=s*s;  

       System.out.println("Area of the square="+a+" square cm");  

  } }

Hope It Helps You!

Answered by Anonymous
17

public class square

{

public static void main()

{

int side = 12 cm;

System.out.println("Area of the square :-")

float area = side×side;

System.out.println(area) ;

System.out.println("Perimeter of the square :-")

float peri = 4×side;

System.out.println(peri);

}

}

Similar questions