Advertisement
glennluc

segitiga

Feb 20th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Segitiga {
  4.  
  5. static int alas;
  6. static int tinggi;
  7. static double luas;
  8. static Scanner s;
  9.  
  10. public static void main(String[]args) {
  11. s = new Scanner(System.in);
  12.  
  13. System.out.print ("Masukkan Alas : ");
  14. alas = s.nextInt();
  15.  
  16. System.out.print ("Masukkan Tinggi : ");
  17. tinggi = s.nextInt();
  18.  
  19. luas = (alas*tinggi)/2;
  20.  
  21. System.out.print("Luas segitiga adalah: " + luas);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement