Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <script>
  2.  
  3. let n = prompt("Enter a number");
  4. let row, col;
  5. for(row = 1; row <= n; row++)
  6. {
  7. for(col = 1; col <= row; col++){
  8. if ((col+row) % 2 == 0){
  9. document.write("1")
  10. }
  11. else{
  12. document.write("0");
  13. }
  14. }
  15. document.write("<br>");
  16. }
  17. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement