A example of a (while, do-while, or for) nested

I am needing a snipit of a (while, do while, or for) nested inside of

Page 1 of 1

4 Replies - 3951 Views - Last Post: 02 October 2009 - 02:17 PM Rate Topic: -----

#1 tmcentire  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 02-October 09

A example of a (while, do-while, or for) nested

Posted 02 October 2009 - 01:53 PM

I am needing a snipit of a (while, do while, or for) nested inside of another while, do while, or for loop.

Thanks, Toni
Is This A Good Question/Topic? 0
  • +

Replies To: A example of a (while, do-while, or for) nested

#2 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: A example of a (while, do-while, or for) nested

Posted 02 October 2009 - 01:58 PM

What have you tried so far in trying to answer your own question?
Was This Post Helpful? 0
  • +
  • -

#3 tmcentire  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 02-October 09

Re: A example of a (while, do-while, or for) nested

Posted 02 October 2009 - 02:05 PM

View PostOler1s, on 2 Oct, 2009 - 12:58 PM, said:

What have you tried so far in trying to answer your own question?


Reading my C++ programming book...the examples aren't very obvious. I also have googled other help forums. Everyone seems to speak different languages. Also I have subscritions to a couple of tutoring sites but 'again' there in not much help/info on this specific question/example.
Was This Post Helpful? 0
  • +
  • -

#4 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: A example of a (while, do-while, or for) nested

Posted 02 October 2009 - 02:14 PM

Here's an example:

#include <iostream>

int main()
{
	for(int i=0; i<10; ++i)
	{
		for(int j=0;j<10; ++j)
		{
			std::cout << i << ' ' << j << '\n';
		}
	}
}


Output:
>cl example.cpp /EHsc /nologo
example.cpp

>example.exe
0 0
0 1
0 2
0 3
<snip>
9 8
9 9



Sometimes, you just need to try things out.
Was This Post Helpful? 0
  • +
  • -

#5 tmcentire  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 02-October 09

Re: A example of a (while, do-while, or for) nested

Posted 02 October 2009 - 02:17 PM

View PostOler1s, on 2 Oct, 2009 - 01:14 PM, said:

Here's an example:

#include <iostream>

int main()
{
	for(int i=0; i<10; ++i)
	{
		for(int j=0;j<10; ++j)
		{
			std::cout << i << ' ' << j << '\n';
		}
	}
}


Output:
>cl example.cpp /EHsc /nologo
example.cpp

>example.exe
0 0
0 1
0 2
0 3
<snip>
9 8
9 9



Sometimes, you just need to try things out.



Thank you!!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1