int rows 5 int number rows int spaces 0 for int i 0 i rows i for int j 0 j

Int rows 5 int number rows int spaces 0 for int i 0 i

This preview shows page 2 - 3 out of 3 pages.

int rows = 5;// int number = rows;// int spaces = 0;// for (int i = 0; i < rows; i++) {// for (int j = 0; j < number; j++) {// System.out.print("*");// }//// for (int j = 0; j < spaces; j++) {// System.out.print(" ");// }//// for (int j = 0; j < number; j++) {// System.out.print("*");// }// spaces += 2;// number -= 1;// System.out.println();// }// }//}//---------------------------------------------------------------// int rows =5;// for (int i = rows; i >= 1; i--) {// for (int j =1; j <=i; j++) {// System.out.print("* ");// }// System.out.println();// }// for (int i=1;i<=rows;i++){// for (int j=1;j<=i;j++){// System.out.print("* ");// }// System.out.println();// }// }//}//------------------------------------------------------------------// int rows=5;// for (int i = rows; i >= 0; i--) {// for (int j = 2 * (rows - i); j >= 0; j--) {// System.out.print(" ");// }// for (int k = 0; k <= i; k++) {// System.out.print("* ");// }// System.out.println();// }// for (int i = 0; i <= rows; i++) {// for (int j = 2 * (rows - i); j >= 0; j--) {// System.out.print(" ");// }// for (int k = 0; k <= i; k++) {// System.out.print("* ");
Background image
// }// System.out.println();// }// }//}//------------------------------------------------------------------//int startRight = 0,// Initialize decending numbers// endSpace = 7;// Initialize number of white space in row//// Display number of rows and numbers in each row//for (int row = 1; row <= 128; row += row) {// // Display white space// for (int startSpace = 0; startSpace < endSpace; startSpace++) {// System.out.print(" ");// }// // Display acending numbers// for (int l = 1; l <= row; l += l) {// System.out.printf("%4d", (l));// }// // Display decending numbers// for (int r = startRight; r > 0 ; r /= 2 ) {// System.out.printf("%4d", (r));// }// System.out.println();// End line// endSpace--; // Decrement endSpace// startRight = row;// Assign row to startRight// }// }// }//----------------------------------------------------------------// int s = 0;// int space = 8;// int rows = 256;// for (int line = 1; line <= rows; line += line) {// for (int sp = 0; sp < space; sp++) {// System.out.print(" ");// }// for (int i = 1; i <= line; i += i) {// System.out.printf("%4d", (i));// }// for (int l = s; l > 0; l /= 2) {// System.out.printf("%4d", (l));// }// System.out.println();// space--;// s = line;// }// }//}
Background image

You've reached the end of your free preview.

Want to read all 3 pages?

  • Spring '17
  • Ijlal

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture