📜  如何在 html 中对数字求平方 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:23.335000             🧑  作者: Mango

代码示例3
class Square
{
    public static void main(String args[])
    {
        int i,sq=0;                        //Variable i and sq are declared
        for(i=1;i<=10;i++)                 //for loop execution takes place
        {
            sq=i*i;
            System.out.println("Square of"+i+"="+sq);//Prints the value stored in the variable i and sq.
        }
    }
}