Draw a triangle Write a program that displays a right triangle composed of eights with sides 10 and 10. Use “for” loop.

package com.javarush.test.level04.lesson13.task03;

import java.io.*;

public class Solution {
    public static void main(String[] args) throws Exception
    {
        //add your code here
        for(int i = 0; i <= 10; i ++){
            for(int j = i; j > 0; j --){
                System.out.print("8");
            }
            System.out.println();
        }

    } }

asked 20 Jun, 06:25

MykytaZ's gravatar image

MykytaZ
11
accept rate: 0%

edited 20 Jun, 07:44


Thanks for help

link

answered 06 Jul, 06:14

blacklight's gravatar image

blacklight
11
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1
×1
×1

Asked: 20 Jun, 06:25

Seen: 64 times

Last updated: 06 Jul, 06:14

Related questions