how do you read...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • monkey1001
    New Member
    • Dec 2007
    • 10

    how do you read...

    this loop to get this answer...


    for(int i=1;1<=10;i++)
    {for(int j=1;1<i;j++)
    S.O.Pln('*');
    S.O.Pln();
    }
    how would you read this i forgot and cant recall...
    the answer is::
    *
    **
    ***
    ****
    *****
    ******
    *******
    ********
    *********
    thank you
    Last edited by monkey1001; Mar 4 '08, 02:02 AM. Reason: added stuff
  • BigDaddyLH
    Recognized Expert Top Contributor
    • Dec 2007
    • 1216

    #2
    I'm confused: is there a question?

    Comment

    • JosAH
      Recognized Expert MVP
      • Mar 2007
      • 11453

      #3
      What is S.O.Pln()?

      kind regards,

      Jos

      Comment

      • sujansarathi
        New Member
        • Mar 2008
        • 6

        #4
        Originally posted by JosAH
        What is S.O.Pln()?

        kind regards,

        Jos

        Its System.out.prin tln

        Comment

        • sujansarathi
          New Member
          • Mar 2008
          • 6

          #5
          Originally posted by monkey1001
          this loop to get this answer...



          thank you

          It will never print the * as u expecting....
          fot int i=1 , it will never print *, for i=2 it starts printing but not in the format as u said.....

          its a loop ranging from -ve values to +ve values for intgerers for 32 bit size machine.
          the logic is wrong...

          Comment

          Working...