473,396 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

help regarding nested FOR loop programming

20
hi to all of you,

i whave program in which i have to display following results using nested for loops :-


1
2 3
4 5 6
7 8 9 10
11 12 13 14
15 16 17 18 19

i m learning java so plz help me if anyone know how to code program to display this result using only nested FOR loops

thankz in advance,,,,,,,,
Oct 28 '07 #1
3 1162
JosAH
11,448 Expert 8TB
hi to all of you,

i whave program in which i have to display following results using nested for loops :-


1
2 3
4 5 6
7 8 9 10
11 12 13 14
15 16 17 18 19

i m learning java so plz help me if anyone know how to code program to display this result using only nested FOR loops

thankz in advance,,,,,,,,
Are you sure that's the figure? Shouldn't that be:

1 <--- 1 number
2 3 <--- 2 numbers
4 5 6 <--- 3 numbers
7 8 9 10 <--- 4 number
11 12 13 14 15 <--- 5 numbers
16 17 18 19 20 21 <--- 6 numbers etc.

kind regards,

Jos
Oct 28 '07 #2
abhu50
20
ya i m defintinely sure dude !!!!!!!
it is correct if anyone know it's coding then try to telll me
thankz
Oct 28 '07 #3
JosAH
11,448 Expert 8TB
ya i m defintinely sure dude !!!!!!!
it is correct if anyone know it's coding then try to telll me
thankz
So you want 1, 2, 3, 4, 4 and 5 numbers in each row? And btw, noone is going
to give you "it's coding" here; click the 'help' link near the top right corner of this
page and read the forum policies.

kind regards,

Jos
Oct 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Martin Schou | last post by:
Please ignore the extreme simplicity of the task :-) I'm new to C, which explains why I'm doing an exercise like this. In the following tripple nested loop: int digit1 = 1; int digit2 = 0;...
46
by: Neptune | last post by:
Hello. I am working my way through Zhang's "Teach yourself C in 24 hrs (2e)" (Sam's series), and for nested loops, he writes (p116) "It's often necessary to create a loop even when you are...
36
by: invni | last post by:
I have a nested while. How do I go from the inner while to the beginning of the outer while? Can this be done without using goto? while_1() { some codes here while_2() { if true go to the...
77
by: Peter Olcott | last post by:
http://www.tommti-systems.de/go.html?http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html The above link shows that C# is 450% slower on something as simple as a nested loop....
77
by: M.B | last post by:
Guys, Need some of your opinion on an oft beaten track We have an option of using "goto" in C language, but most testbooks (even K&R) advice against use of it. My personal experience was that...
5
Reika
by: Reika | last post by:
Hello, I need help understanding some things in programming. I'm taking a high school level programming course, however my teacher is less than helpful in explaining or even understanding the...
8
by: cheetahclaws | last post by:
I am trying to create a function that reverses the halves of an integer array. For example. if the array contains 1,2,3,4 --- after it has gone to the function I constructed, the array will look...
3
by: Michel Esber | last post by:
Hi all, DB2 V8 LUW FP 15 There is a table T (ID varchar (24), ABC timestamp). ID is PK. Our application needs to frequently update T with a new value for ABC. update T set ABC=? where ID...
0
by: LanaR | last post by:
Hello, one sql statement is causing severe performance issue. The problem occurs only in UDB environment, the same statemnt on the mainframe is running fine. I have an explain output from the sql....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.