Tags » Rhombus » Page 2

Program to print Pyramid Rhombus

public class Pyramid{
public static void main(String[] args) {
 int n = 5;
 for (int rows = 0; rows < n-2; rows++) {
 for (int col = 0; col < n; col++) {
 if (2*rows + col >= n-1) {
 System.out.print("* ");
 } 
 else {
 System.out.print(" ");
 } 
 }
 System.out.println();
 }
 for (int rows = 1; rows < n; rows++) {
 for (int col = 0; col < n; col++) {
 if (2*rows <= col) {
 System.out.print("* ");
 } 
 else {
 System.out.print(" ");
 }
 }
 System.out.println();
 }
 }
}

Output:-

     *
   * * *
 * * * * *
   * * *
     *
Pyramids

Equilateral Triangle and Square

A pentagon made up of equilateral triangle with side length on top of square is inside a circle passing through points , and . Find the radius of the circle. 180 more words

Problem Solving

Two Squares

If the vertices of square are the midpoints of the edges of square , then what is the ratio of the area of square to square ? 141 more words

Problem Solving