Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #como #fazer #piramade #de #asteriscos
ADD COMMENT
Topic
Name
5+1 =