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 :)
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.
write a c++ programe to print a triangle without (for)
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.
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
public class welcome { public static void main (String args[]) { System.out.println("Welcome to Java programming"); } } There are also many "Hello World" tutorials you can find elsewhere on the internet
{A program to compute the area of a triangle} {by Ogboin W. Meshach} Var; b,h:real; BEGIN Writeln('Triangle'); Write('Base: '); Readln(base); Write('Height: '); Readln(height); area:=0.5*base*height; Writeln('Area: ', area :0:2); End.