wap in java to find area and perimeter of a square and rectangle
Answers
Answered by
2
HEya friend,
class area
{
public static void main(int l,int b,int l1)
{
System.out.println("AREA OF RECTANGLE IS"+(l*b));
System.out.println("AREA OF SQUARE IS"+(l1*l1));
}
}
HOPE IT HELPS
class area
{
public static void main(int l,int b,int l1)
{
System.out.println("AREA OF RECTANGLE IS"+(l*b));
System.out.println("AREA OF SQUARE IS"+(l1*l1));
}
}
HOPE IT HELPS
Answered by
2
/* Java Program Example - Calculate Area Perimeter of Rectangle */
import java.util.Scanner;
public class JavaProgram {
public static void main(String args[])
{
int len, bre, peri, area;
Scanner scan = new Scanner(System.in);
System.out.print("Enter Length and Breadth of Rectangle : ");
len = scan.nextInt();
bre = scan.nextInt();
area = len*bre; peri = (2*len) + (2*bre);
System.out.print("Area = " +area);
System.out.print("\nPerimeter = " +peri);
}
}
import java.util.Scanner;
public class JavaProgram {
public static void main(String args[])
{
int len, bre, peri, area;
Scanner scan = new Scanner(System.in);
System.out.print("Enter Length and Breadth of Rectangle : ");
len = scan.nextInt();
bre = scan.nextInt();
area = len*bre; peri = (2*len) + (2*bre);
System.out.print("Area = " +area);
System.out.print("\nPerimeter = " +peri);
}
}
Anonymous:
??? write clearly
Similar questions
Social Sciences,
7 months ago
Social Sciences,
7 months ago
Geography,
1 year ago
English,
1 year ago