Series (JAVA)

//Author:  S.Mahbub - uz - zaman
//1 2 4 7 11 16 22 29 37 46 56 ……. Series
//05.05.2010

public class Series{
    public static void main(String args[]){
        int sum=1;
        for(int i=1;i<=100;++i){
            System.out.print(sum+" ");
            sum=sum+i;
        }
        System.out.println();
    }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s