health

Technology

business posts

Powered by Blogger.

Total Pageviews

Name

your name

Email *

Your Email

Message *

your message

Followers

Translate

Pages

Pages

Display Triangle

/*
0
1 0
1 0 1
0 1 0 1 */
class Output2 {

    public static void main(String args[]) {
        for (int i = 1; i <= 4; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(((i + j) % 2) + " ");
            }
            System.out.print("\n");
        }
    }
}

No comments: