Jump to content





Recent Status Updates

  • Photo
      16 Apr
    Kadence

    If you're reading this, you're on my profile and I know you're on my profile because I'm probably viewing yours.

    Show comments (6)
  • Photo
      10 Apr
    Poe

    Finally (and hopefully) i'm getting a team together that knows a little of this and a little of that; and maybe all my open source projects that are half written can begin to be released. :)

View All Updates
Photo
- - - - -

Nested For Loop [EXAMPLES!]

nested loop for loop loop

105 replies to this topic

#85 Ritwik I the programmer

Ritwik I the programmer

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 205 posts
  • Programming Language:Java
  • Learning:Java, C++, Python

Posted 07 March 2013 - 06:45 PM

 

lespauled

Posted 07 March 2013 - 07:29 PM

You people may think you're helping the person by giving them the code, but in fact, you are hindering them.  If a person learns something, it stays with them.  If they are handed something, they learn nothing.

 

This is why I try not to give people the complete code.  I might give them something close, and have them figure out the rest.  Or, if they have something working, I may show them another way. But I do my best to help, not hinder.

Point Taken.


Edited by Ritwik I the programmer, 12 March 2013 - 03:29 AM.

  • 0

1.Make it simple 2.Make it simple 3.Make it simple 4.make it simple 5. ............


#86 GokulBalaji

GokulBalaji

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 13 April 2013 - 09:05 AM

hi,

i need an o/p

1

23

456

78910


  • 0

#87 lespauled

lespauled

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1,125 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash

Posted 13 April 2013 - 09:45 AM

Look for the pattern. Think if it in rows and columns. What would the pattern be?

Maybe the number of items per row has some meaning in the program.
  • 0
My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth

#88 BrennanHacks

BrennanHacks

    CC Lurker

  • New Member
  • Pip
  • 3 posts
  • Programming Language:Java
  • Learning:Java

Posted 17 April 2013 - 03:13 PM

I have an ISU (Independent Study Unit) project.........anyone has any ideas ?

A project must include array, loop, while loop, do while loop..........So, anyone has an idea what should i do in this project ???


  • 0

#89 lespauled

lespauled

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1,125 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash

Posted 18 April 2013 - 05:26 AM

Do something that interests you. If you like movies, make a quick movie list program that shows the current movies. Just pick something you like.
  • 0
My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth

#90 VenceAndrei

VenceAndrei

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 22 January 2014 - 05:52 AM

hi how to program this ?  please help me  :)

 

 

1

23

345

456

6789


  • 0

#91 lespauled

lespauled

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1,125 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash

Posted 22 January 2014 - 06:43 AM

I am sure you can look at previous posts in this thread and find the answer to your problem.  I think this has been answered 50 times before. I recommend reading through the entire thread and learning everything you need to know about loops.


  • 2
My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth

#92 PanjiPro

PanjiPro

    CC Lurker

  • New Member
  • Pip
  • 6 posts
  • Learning:Java, C++, C#, (Visual) Basic, JavaScript, Visual Basic .NET, VBScript, Others

Posted 21 March 2014 - 07:10 PM

1                   10

 

 

 

10                 10

 

 

how to answer this ?/... with using for loop ..

 

please help me huys ..


How to answer this guys ?.. using FOR LOOP ..

please help me :( .. i really need this code ..

 

 

1   2   3   4   5   6   7   8   9   10

2                                            20

3                                            30

4                                            40

5                                            50

6                                            60

7                                            70

8                                            80

9                                            90

10 20 30 40 50 60 70 80 90 100


Edited by PanjiPro, 21 March 2014 - 07:04 PM.

  • 0

#93 KJGino

KJGino

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 424 posts
  • Location:Chicago
  • Programming Language:C, Java, C++, PHP, (Visual) Basic, JavaScript, Visual Basic .NET, Transact-SQL
  • Learning:Python, Assembly

Posted 21 March 2014 - 07:17 PM

What have you tried so far?


  • 1

#94 PanjiPro

PanjiPro

    CC Lurker

  • New Member
  • Pip
  • 6 posts
  • Learning:Java, C++, C#, (Visual) Basic, JavaScript, Visual Basic .NET, VBScript, Others

Posted 21 March 2014 - 07:30 PM

What have you tried so far?

public class test{
public static void main(String args[]){
System.out.print(" ");

    for (int i=1; i<=10; i++)
        System.out.print(" "+i);
  
        System.out.println();

for (int i=2; i<=9; i++){
System.out.print( "" +i);

int j=10;

System.out.print("            

       "+i*j);


System.out.println();
           
        }
      
for (int f=1; f<=10; f++){


int h=10;

System.out.print( ""+f*h);

}   System.out.println();
}
}
 
do you think this correct ?.. can you help me please .. ?.. ;(

  • 0

#95 KJGino

KJGino

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 424 posts
  • Location:Chicago
  • Programming Language:C, Java, C++, PHP, (Visual) Basic, JavaScript, Visual Basic .NET, Transact-SQL
  • Learning:Python, Assembly

Posted 21 March 2014 - 07:42 PM

Let me run it, and see what it outputs.


  • 0

#96 PanjiPro

PanjiPro

    CC Lurker

  • New Member
  • Pip
  • 6 posts
  • Learning:Java, C++, C#, (Visual) Basic, JavaScript, Visual Basic .NET, VBScript, Others

Posted 21 March 2014 - 07:45 PM

Let me run it, and see what it outputs.

ok .. thank you ..

 

how about this ..

 

1                      10

 

 

 

10                    10

 

--> can you solve this problem ?.. please ?..


  • 0





Also tagged with one or more of these keywords: nested loop, for loop, loop