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

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]
*/

Edited 3 Years Ago by Reverend Jim: Fixed formatting

This article has been dead for over six months. Start a new discussion instead.