Home  >  Article  >  Web Front-end  >  JavaScript loop practice method of printing triangles, factorials, and multiplication tables

JavaScript loop practice method of printing triangles, factorials, and multiplication tables

一个新手
一个新手Original
2017-10-12 09:28:302325browse


( i = 1 ; i <= 3 ; i++( x = 1; x <= i; x++&#39;*&#39;&#39;<br>&#39;

Find the sum of factorials 1! +2! +3! +4! +...+N!


 n=prompt(&#39;输入&#39; sum=0( x = 1;x <=n ; x++ factorial=1( y=1; y <= x; y++*=factorial(y-1)*y
rrree

9*9 multiplication table printing


+=
rrree

The above is the detailed content of JavaScript loop practice method of printing triangles, factorials, and multiplication tables. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn