Skip to content

Instantly share code, notes, and snippets.

@smyy96
Created January 20, 2022 22:04
Show Gist options
  • Save smyy96/d1973e3198ded6738c28ed45128e3e9e to your computer and use it in GitHub Desktop.
Save smyy96/d1973e3198ded6738c28ed45128e3e9e to your computer and use it in GitHub Desktop.
Patika Java 101 Üçgen Alan Hesaplama - Patika Java 101 Triangle Area Calculation
import java.util.Scanner;
public class triAreaCalculation {
public static void main(String[] args) {
// Kenar Uzunlukları bilinen üçgenin alanını hesaplama
//Calculating the area of a triangle with known side lengths
Scanner input= new Scanner(System.in);
int first,second,third;
double area=0, u=0;
System.out.print("First side of triangle:");
first=input.nextInt();
System.out.print("Second side of triangle:");
second=input.nextInt();
System.out.print("Third side of triangle:");
third=input.nextInt();
u=(first+second+third)/2;
area=Math.sqrt(u*(u-first)*(u-second)*(u-third));
System.out.print("Area: "+area);
}
}
@smyy96
Copy link
Author

smyy96 commented Jan 20, 2022

Üçgen Alan Hesaplama
Eğitim Linki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment