Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- let n = prompt("Enter a number");
- let row, col;
- for(row = 1; row <= n; row++)
- {
- for(col = 1; col <= row; col++){
- if ((col+row) % 2 == 0){
- document.write("1")
- }
- else{
- document.write("0");
- }
- }
- document.write("<br>");
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement