write a program using function void checker( ) with three integer parameters as the sides of a triangle and decide whether it is a scalene, isoceles or equilateral triangle
Answers
Answered by
2
Explanation:
import java.util.Scanner;
public class Triangle
{
int Checker(int a, int b,int c){
if(a==b&& b== c && c==a)
System.out.println("It is an equilateral triangle");
else if(a== b|| b== c|| c==a)
System.out.println("It is an isoceles triangle");
else
System.out.println("It is a scalene triangle");
return 0;
}
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
System.out.println("Enter the three sides of a triangle");
int m=sc.nextInt();
int n=sc.nextInt();
int o=sc.nextInt();
Triangle obj=new Triangle();
obj.Checker(m,n,o);
}
}
Similar questions
Political Science,
3 months ago
Music,
3 months ago
English,
3 months ago
India Languages,
8 months ago
Math,
8 months ago
English,
1 year ago