A Program To Print A Equilateral Triangle

A Program To Print A Equilateral Triangle

Write A program to Print Following In Java :

           1
         1 1 1
       1 1 1 1 1
     1 1 1 1 1 1 1
   1 1 1 1 1 1 1 1 1
 1 1 1 1 1 1 1 1 1 1 1
View Answers

November 21, 2012 at 12:07 PM

Here is a code that shows following pattern:

           1
         1 1 1
       1 1 1 1 1
     1 1 1 1 1 1 1
   1 1 1 1 1 1 1 1 1
 1 1 1 1 1 1 1 1 1 1 1

public class Pattern {
      public static void main(String[] args) {
        int N=6;
        for(int i=1;i<=N;i++)       {
        for(int j=0;j<N-i;j++)System.out.print(" ");
        for(int j=0;j<(2*i-1);j++) System.out.print("1");
        System.out.println();
        }
     }
}









Related Tutorials/Questions & Answers:
A Program To Print A Equilateral Triangle
A Program To Print A Equilateral Triangle  Write A program to Print Following In Java : 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
How to print a equilateral triangle patren with numbers
How to print a equilateral triangle patren with numbers  I figure out how to use for loop to print the triangle but i couldn't get the exact values as this http://im37.gulfup.com/FzrOb.jpg could you please help me
Advertisements
C Program to Print Pascal Triangle - Development process
C Program to Print Pascal Triangle  I want C Program to Print Pascal Triangle.  Hi Friend, Try the following code: #include #include void main(){ int a[15][15],i,j,rows,num=25,k; printf("\n enter
how to write a program in java to print numbers in equalateral triangle
how to write a program in java to print numbers in equalateral triangle  the output must be 1 324 76589   Here is an example of pattern 1 2 3 4 5 6 7 8 9 Example: public class NumberTriangle{ public
Triangle program
a program for this triangle    1 121 12321 1234321 write a program for this triangle    1 121 12321 1234321 write a program...Triangle program  1 121 12321 1234321 123454321 kindly give
Triangle Program
Triangle Program  i want program code for 1 2 3 4 5 6 7 8 9 10 any body please help me   public class Triangle { public static void main(String[] args
Java Program Floyd's Triangle
Java Program Floyd's Triangle In this section you will read about how to write a Java program to print Floyd's triangle. This tutorial is about... for creating the Floyd's triangle in Java. Before writing a Java program
print rectangle triangle with ?*? using loops
print rectangle triangle with ?*? using loops   * * * * * * i want print like this.what is the code?   import java.lang....("*"); } } System.out.print(" "); } } print("code sample");   class
triangle
valid integers will be entered) Determine and print if they could represent the sides of a triangle If they can form a triangle, determine and print if they can...triangle  Write a program that makes use of a class called
program to print total marks
program to print total marks  program to input total marks out of 600 marks as an argument and print the stream allotted using the following criteria 401 & above - PCM 301-400 - ZBC 201-300- Commerce 101-200 - Arts
write a program to print
write a program to print   write a program to print following 1 2 3 4 5 4 3 2 1 1 2 3 4 4 3 2 1 1 2 3 3 2 1 1 2 2 1 1 1
C program to print the following
C program to print the following  Hello, Some one help me with a "C Program" to print the following as output: 4444444 4333334..., that is why I choosed Java Beginners, but please give me a C program
Write a program to print using for loop
Write a program to print using for loop  Write a program to print using for loop * * * *  
Write a program to construct a triangle with the ?*?
Write a program to construct a triangle... programming will teach you the coding for constructing a shape of triangle by using '*'. First of all make a class named 'triangle' under the Java I/O package
triangle
triangle  how to draw triangle numbers with stars in html with the help of javascript
C Print Pascal Triangle
C Print Pascal Triangle In this section, you will learn how to display Pascal's triangle. A Pascal's triangle is a geometric arrangement of the binomial coefficients in a triangle.The rows of Pascal's triangle are conventionally
C program - Java Magazine
of a right-angled triangle, equilateral triangle, isosceles triangle or a scalene..., the program should print the following; The three integers form a Right-angled...", &c); if((a==b)&&(b==c)&&(c==a)){ printf("Equilateral Triangle \n
write a program in C to print following triangles on the screen
write a program in C to print following triangles on the screen  write a program in C to print following triangles on the screen
write a program to use for loop print **********========== in c language
write a program to use for loop print **********========== in c language  write a program to use for loop print **========== in c language
ModuleNotFoundError: No module named 'my_print_haha_program'
ModuleNotFoundError: No module named 'my_print_haha_program'  Hi...: No module named 'my_print_haha_program' How to remove the ModuleNotFoundError: No module named 'my_print_haha_program' error? Thanks   Hi
C Program to Print Following Output - Development process
C Program to Print Following Output  Hello Sir I wnat to print Followning output in C Language with for loop How I Can Print it? 5 5 4 5 4 3 5 4 3 2 5 4 3 2 1  Hi Friend, Try the following: #include
C Program to Print Stras - Development process
C Program to Print Stras  How I can Print Following Output using Two For loops in C Language? * * * * * * * * * * * * * * * *  Hi Friend, Try the following: #include #include void main(){ int i=0
triangle output
triangle output  program to get the following output
How to print the following output using c program
How to print the following output using c program  1) 4 3 4 2 3 4 1 2 3 4 2) A B C D E F G H I J
java program - Java Beginners
of the triangle and then the program; a)First determines whether the 3 integers entered represent the sides of a right-angled triangle, equilateral triangle, isosceles...java program  what is the program the a simple program in Java
WRITE A PROGRAM TO PRINT OUT THE NUBERS 10 THROUGH 49
WRITE A PROGRAM TO PRINT OUT THE NUBERS 10 THROUGH 49   write a program to print out the number 10 through 49 in the following manner 10 11 12 13 ......19 20 21..............29 30 31..............39 40 4142............49
triangle output
triangle output  program to get the following output: * *   Hi Friend, Please specify the pattern properly.ADS_TO_REPLACE_1 Thanks
pascal triangle
pascal triangle   given string : char str[]="123456789"; write a program in 'c'-language that displays the following: 1 232... the following link:ADS_TO_REPLACE_1 C Pascal's Triangle Thanks
triangle shape
triangle shape  Hi, I have to create a program which its output is: + ++ +++ ++++ and this what I did so far : package symbols; import... symbol; System.out.print(" how many lines you want to print? "); nline
Triangle problem
Triangle problem  what's the logic for create pattern program how can i create any pattern program with in minute. like this 1 2 5 3 6 8 4 7 9 10
ModuleNotFoundError: No module named 'triangle'
ModuleNotFoundError: No module named 'triangle'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'triangle' How to remove the ModuleNotFoundError: No module named 'triangle
simple program
simple program  how to print * like triangle
print
print  How to print JFrame All Componant?   Please visit the following link: http://www.roseindia.net/java/example/java/swing/Print.shtml
Write a java program that prints the decimal representation in reverse. (For example n=173,the program should print 371.)c
Write a java program that prints the decimal representation in reverse. (For example n=173,the program should print 371.)c  class rose { int n...); System.out.println("\nReverse the number"+i); S.out(); } }   print
Triangle pgm
Triangle pgm  how to write code fa this??? 1 222 33333 4444444 55555555 666666666
Print
into the stream and, as opposed to print() method, gets you to the new line after the text
Code for a triangle.....
Code for a triangle.....   1 1 5 1 1 5 25 5 1 What is the source Code for above output
write a java program to print marklist of n students. input Register number, name and marks of three subjects.
write a java program to print marklist of "n " students. input Register number, name and marks of three subjects.  write a java program to print marklist of "n " students. input Register number, name and marks of three subjects
ModuleNotFoundError: No module named 'Pascal_Triangle'
ModuleNotFoundError: No module named 'Pascal_Triangle'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'Pascal_Triangle' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'Pascal_Triangle'
ModuleNotFoundError: No module named 'Pascal_Triangle'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'Pascal_Triangle' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'right-triangle'
ModuleNotFoundError: No module named 'right-triangle'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'right-triangle' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'triangle_plot'
ModuleNotFoundError: No module named 'triangle_plot'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'triangle_plot' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'Flask-Triangle'
ModuleNotFoundError: No module named 'Flask-Triangle'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'Flask-Triangle' How to remove the ModuleNotFoundError: No module named
Modify the sales tax program to accept an arbitrary number of prices, total them, calculate the sales tax and print the total amount.
Modify the sales tax program to accept an arbitrary number of prices, total them, calculate the sales tax and print the total amount.  Modify the sales tax program to accept an arbitrary number of prices, total them, calculate
Floyd's triangle
Floyd's triangle  Write a 'for' statment that will print Floyd's traingle.   Hi Friend, Try the following code:ADS_TO_REPLACE_1 public class FloydTriangleExample { public static void main(String[] args) throws
Java create triangle pattern
Java create triangle pattern In this tutorial, you will learn how to create a triangle shape. For this, user is allowed to enter number of lines to display the triangle of that length and a symbol to show the triangle in a particular
Golden triangle tours
Golden triangle tours  Hi, Can anyone tell me something about Golden triangle tours? Thanks   Hi, Golden Triangle tour cover Delhi, Agra and Jaipur. Please check India Golden Triangle Tours. Thanks
Golden Triangle Tours
Golden Triangle Tours  What is golden triangle tours ..and how it is related to the Agra and Jaipur and Delhi trip? Please explain me. Thanks
PLEASE Help me write a Java program which will store, manipulate, and print student registration information.
PLEASE Help me write a Java program which will store, manipulate, and print..., ADDRESS AND ADMISSIONS CLASS PLEASE HELP!!! Write a Java program which will store, manipulate, and print student registration information. As part
ModuleNotFoundError: No module named 'print_print'
ModuleNotFoundError: No module named 'print_print'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'print_print' How to remove the ModuleNotFoundError: No module named '

Ads