Welcome Guest.

2Answers

The javascript  function calls the ninety-nine multiplication table  the multiplication table of the first few lines appears on the output of the first few lines

Asked by: Cynthia Campbell 222 views IT May 25, 2019

The javascript  function calls the ninety-nine multiplication table  the multiplication table of the first few lines appears on the output of the first few lines

2 Answers

  1. +5Votes  

    Hello, here is a copy of the output from the console:

    123456789var out = "", tmp;for (var i = 9;  i > 0; i–) {    for (var j = 9; j >= i;  j–) {        tmp = ((i * j) < 10 ? " 0" + (i * j) : (i * j));        out +=  ("0" + j + "x" + "0" + i + "=" +  Tmp + " ");    }    out += "\n";}console.log(out);

    If you need to output on the page, you only need to make a few changes:

    12345out += "\n"; // Change to out += ""; console.log(out); //&nb Sp; changed to the corresponding HTML element. innerHTML = out;

    Hope is the answer you want, hope to adopt ~~

    saber- May 24, 2019 |

  2. +6Votes  

    # Include <stdio.h>
    void func(int n)
    {
    int i,j;
    for(i=1;i<=n;i++)
    {
    for(j=1;j<=i;j++)
    printf("%d*%d=%2d ",i,j,i*j);
    printf("\n");
    }
    }
    void main ()
    {
    func(9);
    }

    saber- May 24, 2019 |