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

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

一个新手
Release: 2017-10-12 09:28:30
Original
2407 people have browsed it


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

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
Copy after login
rrree

9*9 multiplication table printing


+=
Copy after login
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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template