Answers for "como fazer piramade de asteriscos"

0

como fazer piramade de asteriscos

<pre>
<script>
    //Reads number of rows to be printed
    var n = 8;
 
    for(i=1; i<=n; i++)
    { 
        //Prints trailing spaces
        for(j=i; j<n; j++)
        {
            document.write(" ");
        }
 
        //Prints the pyramid pattern
        for(j=1; j<=(2*i-1); j++)
        {
            document.write("*");
        }
 
        document.write("<br>");

        }
</script>
</pre>
 Run code snippet
Posted by: Guest on October-14-2021

Code answers related to "como fazer piramade de asteriscos"

Code answers related to "Javascript"

Browse Popular Code Answers by Language