public class Program_9 {
public static void main(String[] args) {
int i, j, k;
String str = "Stream";
for (i = 0; i < str.length(); i++) {
for (j = (str.length() / 2) + 1; j >= i; j--) {
System.out.print(" ");
}
for (k = 0; k <= i; k++) {
System.out.print(str.charAt(k) + " ");
}
System.out.println();
}
}
}
Find all the practical at one place of Gujarat Technological University(GTU) With Solutions.
Saturday, October 6, 2018
Write an interactive program to print a string entrered in a pyramid form. For instance, the string "stream"
Subscribe to:
Posts (Atom)
-
A country has a capital city A dining philosopher uses a fork A file is an ordinary file or a directory file Files cont...
-
import java.io.*; public class Dataio { public static void main(String args[]) throws IOException { DataInputStr...