Home Answers Viewqa Java-Beginners A Program To Print A Equilateral Triangle

 
 


Yash Agarwal
A Program To Print A Equilateral Triangle
1 Answer(s)      7 months ago
Posted in : Java Beginners

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 Pages:
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
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
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
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
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
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
Write a program to construct a triangle with the ?*?
Write a program to construct a triangle... of times we have to print *.  Now compile and run the program and insert... programming will teach you the coding for constructing a shape of triangle by using
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 Traingles { public
triangle output
triangle output  program to get the following output
triangle output
triangle output  program to get the following output: * *   Hi Friend, Please specify the pattern properly. Thanks
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
pascal triangle
pascal triangle   given string : char str[]="123456789"; write a program in 'c'-language that displays the following: 1 232... the following link: C Pascal's Triangle Thanks
srinu
srinu  how to print a equilateral triangle (*) in java
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
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
Floyd's triangle
Floyd's triangle  Write a 'for' statment that will print Floyd's traingle.   Hi Friend, Try the following code: public class FloydTriangleExample { public static void main(String[] args) throws Exception { int k=0
simple program
simple program  how to print * like triangle
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
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
triangle
triangle  how to draw triangle numbers with stars in html with the help of javascript
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
Write a program to print using for loop
Write a program to print using for loop  Write a program to print using for loop * * * *  
How to calculate area of triangle
tutorial program in the section you see that how to get triangle values. First... of triangle. Then the program perform and  return of triangle value... Area of Triangle      
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
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
TRIANGLE OF *S AT THE BOTTOM RIGHT!!! - Java Beginners
TRIANGLE OF *S AT THE BOTTOM RIGHT!!!  My Question is to : "Write a program that inputs one integer m and outputs an m-line high triangle of *'s... to make the triangle at the right side but couldn't do so. Can you please solve
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
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
noise during print screen
noise during print screen  hi there, i have a java program which can print screen every 1 seconds... but during the print screen, the image seems will have some noise and ends up half page of the image will be black screen
print a rectangle - Java Beginners
print a rectangle  how do I print a rectangleof stars in java using simple while loop?Assuming that the length n width of the rectangle is given...("Give me the size of each triangle : "); int size = Integer.parseInt(n.readLine
India Golden Triangle Tours with Ranthambore
Golden Triangle Tour with Ranthambore Duration: 6 Nights 7 Days Destinations Covered: Delhi- Mathura- Agra-Jaipur-Ranthambore-Delhi Day 01: Arrive... hotel. In the evening you will be briefed about your tour program, dinner
print the below pattern
print the below pattern  to write a program using a function ti initialize a character 'A' and print the following pattern of characters upto six lines A A B A B C A B C D A B C D E A B C D E F
print hello n hi
print hello n hi  how to write a java program that prints "hello" 5 times, "hi" 1 time n again "hello" 4 times..?? do reply
program
program  write a java program to input a no. and print wheather the no. is a special no or not. (special no. are those no whose factorial of the sum of digit of the no is same as the original
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
print
print  How to print JFrame All Componant?   Please visit the following link: http://www.roseindia.net/java/example/java/swing/Print.shtml
print - JSP-Servlet
print  write easy program for printing a page?   Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/swing/Print.shtml Hope that it will be helpful for you. Thanks
Triangle pgm
Triangle pgm  how to write code fa this??? 1 222 33333 4444444 55555555 666666666
program
program  Write a program to print details of a week for a particular day using array of objects Integer and String. OUTPUT: First Day of Week is Monday Second Day of Week is Tuesday Third Day of Week is Wednesday Forth Day
program
called print to display the employee details in below format: "Employee E001... and invoke the setEmployeeDetails and print method. Document your code and follow
Print
into the stream and, as opposed to print() method, gets you to the new line after the text
program
program  )Create a class called College with a method displayDetails which should print "IIT Mumbai" in console. Inside the main method instantiate the College class and invoke the method.   hi dhivya, Here I am giving
India Golden Triangle Tours With Udaipur
India Golden Triangle Tours With Udaipur Duration: 07 Nights / 08 Days Destinations : Delhi-Agra-Jaipur-Udaipur Day 01: Arrival-Delhi On Arrival... of Chokhi-Dhani and relish the Rajasthani dinner, cultural program and folk dance
Print the URL of a URLConnection
Print the URL of a URLConnection       In this section we are going to describe, how to retieve... of the program in which first of all we establish a connection then display
Golden Triangle Vacation Tour India
Triangle Vacation tour program. Dinner and overnight stay at the hotel...Golden Triangle Vacation Tour India Duration: 06 Nights / 07 Days... and overnight stay at hotel. Day 05: Jaipur of Golden triangle Vacation Tour
program - Java Beginners
program  write a program to print the following pattern... is not coming.. see my program... import java.io.*; class triangle... java.io.*; public class triangle { public static void main (String[] args