Created
January 20, 2022 22:04
-
-
Save smyy96/d1973e3198ded6738c28ed45128e3e9e to your computer and use it in GitHub Desktop.
Patika Java 101 Üçgen Alan Hesaplama - Patika Java 101 Triangle Area Calculation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Üçgen Alan Hesaplama
Eğitim Linki