-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfor-loop.html
More file actions
41 lines (33 loc) · 856 Bytes
/
for-loop.html
File metadata and controls
41 lines (33 loc) · 856 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
<html>
<head>
<title>Title of the document</title>
</head>
<body >
<script>
// for(var i=1; i<=5; i++){ //first Exmp for nasted value
// for(var j=1; j <= i; j++){
// document.write(j + " ");
// }
// document.write("<br>");
// }
// for(var i=1; i<=5; i++){ // second Exmp
// for(var j=1; j <= i; j++){
// document.write(i + " ");
// }
// document.write("<br>");
// }
// for(var i=5; i>=1; i--){ //third
// for(var j=1; j <= i; j++){
// document.write(i + " ");
// }
// document.write("<br>");
// }
for(var i=5; i>=1; i--){ //fourth
for(var j=i; j >= 1; j--){
document.write(j + " ");
}
document.write("<br>");
}
</script>
</body >
</html>