-
Notifications
You must be signed in to change notification settings - Fork 0
/
Praktikum2-no.3.cpp
53 lines (48 loc) · 1014 Bytes
/
Praktikum2-no.3.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//PROGRAM MENGHITUNG SEGITIGA SIKU SIKU
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int A,B,C1,code;
float L,C,Kel;
cout<< endl;
cout<< "PROGRAM HITUNG SEGITIGA SIKU-SIKU";
cout<< endl;
cout<< endl;
cout<< endl;
cout<< " Masukkan Alas Segitiga = "; cin>> A;
cout<< " Masukkan Tinggi Segitiga = "; cin>> B;
cout<< endl;
cout<< endl;
cout<< "KODE PENCARIAN:";
cout<< "\n Mencari Sisi Miring, (1)";
cout<< "\n Mencari Luas, (2)";
cout<< "\n Mencari Keliling, (3)";
cout<< endl;
cout<< "\n Masukkan Kode Pencarian = ";
cin>> code;
cout<< endl;
cout<< endl;
switch (code)
{
case 1:
C1 = A*A + B*B;
C = sqrt(C1);
cout<< " PANJANG SISI MIRING = "<<C;
break;
case 2:
L = float(A*B)/2;
cout<< " LUAS SEGITIGA = "<<L;
break;
case 3:
C1 = A*A + B*B;
C = sqrt(C1);
Kel = A + B + C;
cout<< " KELILING SEGITIGA = "<<Kel;
break;
}
cout<< endl;
cout<< endl;
return 0;
}