Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upevaluate rectangle or square #1938
Conversation
evaluate whether it is rectangle or square
Evaluate whether given parametre form rectangle or square
|
Cloud you reformat your code ? |
| Scanner sc=new Scanner(System.in); | ||
| int a=sc.nextInt(); | ||
| int b=sc.nextInt(); | ||
| int c=sc.nextInt(); | ||
| int d=sc.nextInt(); | ||
| if(a==b && a==c && b==c && c==d && d==b && a==d){ | ||
| //if(a=b=c=d){ | ||
| System.out.println("SQUARE"); | ||
| return; | ||
| } | ||
| if(a==b && c==d || a==d && b==c || a==c && b==d ){ | ||
| System.out.println("RECTANGLE"); | ||
| } | ||
| else System.out.println("NEITHER RECTANGLE OR SQUARE."); |
shellhub
Oct 24, 2020
Member
We should write these code in function.
We should write these code in function.
class name in uppercase. evaluation of rectangle or square in function
Describe your change:
References
Checklist:
Fixes: #{$ISSUE_NO}.