Please help me with this question
Attachments:
misty16:
what is that
Answers
Answered by
1
Hi,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Asterisk Rows Printer</title>
</head>
<body>
<script>
var howManyRows = parseInt(prompt('How many rows you want?'));
var currentRow = '';
for (var i = 0; i <= howManyRows; i++) {
for (var j = 0; j < i; j++) {
currentRow += "*";
}
currentRow += "<br>";
};
document.write(currentRow);
</script>
</body>
</html>
All you have to do is just copy this code and paste in notepad.. then save it as .html and then open it n web browser....
Attachments:
Similar questions