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
No.
a triangle then a square :)
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.
write a c++ programe to print a triangle without (for)
If you forget the semicolon, your program won't compile.
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.
Try the triangle program on a search engine. Replace numbers with stars and that should do the trick
Write a function that print a triangle of stars.
"Ten PRINT" 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.
With a text editor, and some basic knowledge of the C programming language.
To program a PCR-T465 cash register to print the store name, first access the programming mode by pressing the "Mode" key and then entering the password if required. Navigate to the store settings or "Program" section, select the option for "Store Name," 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.
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