Write a JAVA program that will generate/output the following numbers.
1, 2, 4, 7, 11, 16, 32, 39, 47, 56, 66
(using looping)

Recommended Answers

All 6 Replies

Okay. Finished.

commented: Good program. +19

I have a feeling you wrote it in your head but didn't actually type it Masijade. Cheater! Lol.

Write a JAVA program that will generate/output the following numbers.
1, 2, 4, 7, 11, 16, 32, 39, 47, 56, 66
(using looping)

Typo: 1, 2, 4, 7, 11, 16, 22, 29, 37, 46, 56
Much easier like this lol! :D

loozax,
Problems are good for the programming. I read all threads(three) posted by you; all threads are missing suitable thread title and you never follow-up valuable comments posted by venerable members.
Please show us your work and read following rule:
1.Homework policy
2.How to post source code?
3.Title of thread must reflect your question.

public class looping {// start class

    private static int  value = 1;// declare int value = 1

    public static void main (String[] args){//start method
        for (int i = 1; i<=10;i++ ){//start loop
            System.out.println(value);//print out the value
            value = i + value; //adding the valu of i while looping 
        }//end of loop
    }//end of method
}//end of class looping

/*
* 05091987revilogadnul
* 2009
* Applied Ideas Inc.
* [url]www.applied-ideas.com.ph[/url]
* [email]oliver_lundag@yahoo.com[/email]
*/

Welcome oliver_lundag,
Read daniweb rule - See post #5

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.