Computer Science, asked by sikhasmrutisahoo, 8 months ago

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 sahupriyanshu710
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