-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathincremento.php
53 lines (47 loc) · 1.42 KB
/
incremento.php
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Diferença entre Pré e Pós-incremento</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
.container {
width: 300px;
margin: 50px auto;
padding: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
text-align: center;
}
.result {
margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<h2>Diferença entre Pré e Pós-incremento</h2>
<div class="result">
<?php
$i = 0;
echo "<h3>Pré-incremento (++\$i):</h3>";
echo "Valor inicial de \$i: $i <br>";
echo "Valor após o pré-incremento: " . ++$i . "<br>";
echo "Valor final de \$i: $i <br>";
$j = 0;
echo "<h3>Pós-incremento (\$j++):</h3>";
echo "Valor inicial de \$j: $j <br>";
echo "Valor antes do pós-incremento: " . $j++ . "<br>";
echo "Valor final de \$j: $j <br>";
?>
</div>
</div>
</body>
</html>