figuras

    0

    0

    ismael zian

    figuras

    Shortcut: figuras

    document.write("Figura A<br>")
    fil = window.prompt("filas")
    col = window.prompt("columnas")
    for (let i = 0; i < fil; i++) {
    
      for (let i = 0; i < col; i++) {
        document.write("*") 
      }
      document.write("<br>")   
    }
    
    document.write("<br>")
    document.write("Figura B<br>")
    for (let i = 0; i < fil; i++) {
    
      for (let j = 0; j < col; j++) {
        if (i==0||i==fil-1||j==0||j==col-1) {
          document.write("*")    
        }
        else{
          document.write("&nbsp")
        }
    
      }
      document.write("<br>")    
    }
    
    document.write("<br>")
    document.write("Figura C<br>")
    for (let i = 0; i < fil; i++) {
    
      for (let j = 0; j < i+1; j++) {
        document.write("*") 
      }
    
      document.write("<br>")   
      }
    document.write("<br>")
    document.write("Figura D<br>")
    for (let i = 0; i < fil; i++) {
    
      for (let j = 0; j < i+1; j++) {
        document.write("&nbsp") 
      }
      for (let k = 0; k < fil-(i+1); k++) {
        document.write("*") 
      }
    
      document.write("<br>")   
    }
    
    document.write("<br>")
    document.write("Figura E<br>")
    for (let i = 0; i < fil; i++) {
    
      for (let j = 0; j < fil-(i+1); j++) {
        document.write("&nbsp") 
      }
      for (let k = 0; k < i+1; k++) {
        document.write("*") 
      }
    
      document.write("<br>")   
    }
    
    document.write("<br>")
    document.write("Figura F<br>")
    for (let i = 0; i < fil; i++) {
    
      for (let j = 0; j < col-i; j++) {
        document.write("*") 
      }
    
      document.write("<br>")   
      }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.