forked from dayanec/git-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4.2
More file actions
64 lines (40 loc) · 1.05 KB
/
4.2
File metadata and controls
64 lines (40 loc) · 1.05 KB
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
54
55
56
57
58
59
60
61
62
63
64
<?php //Segundo exercicio
echo "<table width='0' border='1'>
<tr>
<td><b>ID</td>
<td><b>NOME</td>
<td><b>DESC</td>
</tr>";
for($i = 1; $i<7; $i = $i + 1){
echo "<tr>
<td>id</td>
<td>nome</td>
<td>desc</td>
</tr>";
}
echo "</table>";
?>
<?php //exercicio numero primo
$n=0;
$x=2;
for ($i=1; $i<=$x; $i++){
if (($x%$i)==0) $n++;
}
if ($n<=2){
echo "O numero é primo.";
}else{
echo "O número não é primo.";
}
?>
</br>
<?php //exercico fibonacci
$n1=0;
$n2=1;
for ($n3=0; $n3<9; $n3++){
$n2=$n2+$n1;
$n1=$n2-$n1;
echo $n1.",";
}
?>
<html>
</html>