This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="id"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Kalkulator Segitiga Anti-Error</title> | |
| <style> | |
| /* Gaya Tampilan (CSS) */ | |
| body { | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; |
This file contains hidden or 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
| Module Module1 | |
| Sub Main() | |
| Dim alas As Double | |
| Dim tinggi As Double | |
| Dim luas As Double | |
| Console.Write("Masukkan alas: ") | |
| alas = Console.ReadLine() | |
| Console.Write("Masukkan tinggi: ") |
This file contains hidden or 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 <Foundation/Foundation.h> | |
| int main(int argc, const char * argv[]) { | |
| @autoreleasepool { | |
| // Deklarasi variabel | |
| float alas, tinggi, luas; | |
| // Input nilai (contoh: alas=10, tinggi=5) | |
| alas = 10.0; | |
| tinggi = 5.0; |
This file contains hidden or 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 LuasSegitiga { | |
| public static void main(String[] args) { | |
| // Membuat objek scanner untuk menerima input | |
| Scanner input = new Scanner(System.in); | |
| System.out.println("=== Program Hitung Luas Segitiga ==="); | |
| // Input alas dan tinggi |
This file contains hidden or 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
| # Program Python untuk menghitung luas segitiga | |
| # Mengambil input alas dan tinggi dari pengguna | |
| alas = float(input("Masukkan panjang alas: ")) | |
| tinggi = float(input("Masukkan tinggi segitiga: ")) | |
| # Menghitung luas segitiga | |
| luas = 0.5 * alas * tinggi | |
| # Menampilkan hasil |
This file contains hidden or 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
| #include <stdio.h> | |
| int main() { | |
| float alas, tinggi, luas; | |
| // Meminta input dari pengguna | |
| printf("Masukkan alas segitiga: "); | |
| scanf("%f", &alas); | |
| printf("Masukkan tinggi segitiga: "); | |
| scanf("%f", &tinggi); |
This file contains hidden or 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
| <?php | |
| // Tentukan alas dan tinggi | |
| $alas = 10; | |
| $tinggi = 5; | |
| // Hitung luas | |
| $luas = 0.5 * $alas * $tinggi; | |
| // Tampilkan hasil | |
| echo "Alas: " . $alas . " cm<br>"; |
This file contains hidden or 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
| let alas = prompt("Masukkan alas:"); | |
| let tinggi = prompt("Masukkan tinggi:"); | |
| let luas = 0.5 * alas * tinggi; | |
| alert("Luas Segitiga = " + luas); |
This file contains hidden or 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 'dart:io'; | |
| void main() { | |
| stdout.write("Masukkan alas: "); | |
| double? alas = double.parse(stdin.readLineSync()!); | |
| stdout.write("Masukkan tinggi: "); | |
| double? tinggi = double.parse(stdin.readLineSync()!); | |
| double luas = 0.5 * alas * tinggi; |
This file contains hidden or 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
| using System; | |
| namespace LuasSegitigaApp | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| // Input alas dan tinggi | |
| Console.Write("Masukkan alas: "); |
NewerOlder