please help

javascript Delhi, India
  • 13 years ago

    I am new to programming.  I am currently taking a class on javaScript and the teacher I have is not very helpful.  I need to write a script that produces the following by utilizing nested for loops:

    @@@@@@

    @@@@@@

    @@@@@@

    @@@@@@

    @@@@@@

    @@@@@@

    this is what I have so far:

    for(varRow=0;5;){

    for(varCol=0;5;)

    i am not sure how to input the "@" but i think i know how to display it: (document.writeln(whatever i used to input the @)

    thanks for your help.

  • 13 years ago

    Hi Tejamj,

    Here is the simple code that prints your desired out put. 

     <html>

    <head>

    <script language=javascript>

    function disp()
    {
        for(a=1;a<=6;a++)
        {
            for(b=1;b<=6;b++)
            {
                document.write("@");
            }
        document.write("<br><br>");
        }
    }
    </script>

    </head>

    <body onload='disp();'>

    </body>

    </html>

  • 13 years ago

    thank you very much hon33y.  it works beautifully and i am forever in your debt.Wink

  • 13 years ago

    first of all apology because i was out of town thats why replying you late.

    well mention not tejamj4. We guys are here to help ppl.

    stay cool and have a gr8 day. 

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook