-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
43 lines (43 loc) · 924 Bytes
/
index.php
File metadata and controls
43 lines (43 loc) · 924 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>Cara Menghitung Pangkat di PHP</title>
</head>
<body>
<h3>Script PHP untuk Menghitung Pangkat dengan Fungsi pow()</h3>
<form method="POST">
<table>
<tr>
<td>Nilai Bilangan</td>
<td>:</td>
<td><input name="bilangan" type="number"/></td>
</tr>
<tr>
<td>Pangkat</td>
<td>:</td>
<td><input name="pangkat" type="number"/></td>
</tr>
<tr>
<td></td>
<td></td>
<td><input name="submit" type="submit" value="SUBMIT"/></td>
</tr>
<tr>
<td></td>
<td></td>
<td>
<?php
if(isset($_POST['submit'])){
$bilangan =$_POST["bilangan"];
$pangkat =$_POST["pangkat"];
$hasil =pow($bilangan, $pangkat);
echo '<br />';
echo $bilangan; echo'<sup>'.$pangkat.'</sup>'; echo" = ";echo $hasil;
}
?>
</td>
</tr>
</table>
</form>
</body>
</html>