Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class PracticifValue
- {
- public static Scanner reader = new Scanner(System.in);
- public static void main(String[] args)
- {
- System.out.print("enter Length: ");
- Double L = reader.nextDouble();
- System.out.print("enter width: ");
- Double W = reader.nextDouble();
- if (L != W){System.out.println("it is not a squre its a rectangle");}
- if (L == W){
- System.out.println("Length of the squre: ");
- System.out.println(L*2+W*2);
- System.out.println("width of the squre: ");
- System.out.println(L*W);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement