Computer Science, asked by Anonymous, 1 year ago

wap in java to find area and perimeter of a square and rectangle

Answers

Answered by anuj
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
Answered by steeve
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);

}
}

Anonymous: ??? write clearly
steeve: what's your standard
Anonymous: sorry..actually few moments ago woh bina space ke display hua tha..thats y i wrote that...
Anonymous: its was looking like a paragraph...now its okay:-)
steeve: tell me your class
Anonymous: inbox
steeve: hmm
Anonymous: i think ve blocked me? or something?
steeve: wait few moments
Similar questions