codinasion-archive / codinasion-programme

An open source codebase for sharing programming solutions.
https://codinasion.vercel.app/programme
MIT License
62 stars 147 forks source link

Area of Triangle #372

Closed harshraj8843 closed 2 years ago

harshraj8843 commented 2 years ago

Title of article

Write a Java programme to find area of triangle.

Additional information

a : 10
b : 17
c : 21

s : 24

area : 84

s

area

Code of Conduct

Glogius95 commented 2 years ago
public static void main(String[] args) {
 area(10, 17, 21);
}
public static int area(int a, int b, int c){
  int s = (a+ b + c) / 2;
  int area = (int) Math.sqrt(s * (s-a) * (s - b) * (s - c));
    System.out.println("Area : " + area);
  return area;
}

}`

harshraj8843 commented 2 years ago

Hey @Glogius95

Thanks for showing your interest in this open source project 😃

Could you please open a pull request for this