answersLogoWhite

0

public class equitraingle {

public static void main(String[ ] args) {

int numrows=6; // changing the value of numrows,respective o/p will be printed

for(int i=1;i<numrows;i++){

for(int j=1;j<numrows-i;j++)

{

System.out.print(" ");

}

for(int k=1;k<=i;k++){

System.out.print(k+" ");

}

System.out.println("");

}

}

}

o/p:

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Do I need a C plus plus program to print PASCAL's triangle?

No.


Write a program in qbasic to make a hut using print statemant?

a triangle then a square :)


Print upper and lower triangle of a matrix?

To print the upper triangle of a matrix, iterate through its rows and columns, printing elements where the column index is greater than or equal to the row index. For the lower triangle, print elements where the column index is less than or equal to the row index. In programming languages like Python, this can be easily achieved using nested loops. For example, for a matrix A, the upper triangle can be printed with for i in range(n): for j in range(i, n): print(A[i][j]), and similarly for the lower triangle.


How do you print a triangle of stars?

write a c++ programe to print a triangle without (for)


Can you print string without using semi column in printf statement in c programming?

If you forget the semicolon, your program won't compile.


Do a program with turbo pascal to print the alphabet backward?

Turbo Pascal is a style of computer programming. This type of writing language can be used to create a program that prints the alphabet backwards.


How do you write a program to print numbers from star one and next line star two in php?

Try the triangle program on a search engine. Replace numbers with stars and that should do the trick


Write a C plus plus function that print a triangle of stars?

Write a function that print a triangle of stars.


What is meaning of ten printed?

&quot;Ten PRINT&quot; commonly refers to a one-line BASIC program that generates a maze-like pattern when executed. This program has become a symbol of creative programming simplicity and has inspired various artistic and creative projects.


How do you write a c program to store 5 names in structures and print them each in one line?

With a text editor, and some basic knowledge of the C programming language.


How do you program a PCR-T465 cash register to print the store name?

To program a PCR-T465 cash register to print the store name, first access the programming mode by pressing the &quot;Mode&quot; key and then entering the password if required. Navigate to the store settings or &quot;Program&quot; section, select the option for &quot;Store Name,&quot; and then input the desired name using the numeric keypad. Finally, save the changes and exit the programming mode to ensure the store name is printed on receipts.


How do you program a uniden bc144xz scanner?

Follow the link below to download/print an operating manual that will walk you through the programming process: http://www.scribd.com/doc/2056189/UBC144XLT