hw10_07_ chess one line.html 392 B

12345678910111213141516171819
  1. <head>array fill</head>
  2. <body>
  3. <script>
  4. let a = 0;
  5. let b = (confirm("ODD or Even"));
  6. if (b) {
  7. a = +prompt("enter ODD number elements");
  8. }
  9. else
  10. a = +prompt("enter even number elements");
  11. let str = "";
  12. for (let i = 0; i < a; i++) {
  13. str += " #";
  14. }
  15. alert(str);
  16. </script>
  17. </body>