Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

print symbol in pyramid shape in java

public class PyramidPattern  
{    
public static void main(String args[])   
{    
//i for rows and j for columns      
//row denotes the number of rows you want to print  
int i, j, row = 6;       
//Outer loop work for rows  
for (i=0; i<row; i++)   
{  
//inner loop work for space      
for (j=row-i; j>1; j--)   
{  
//prints space between two stars  
System.out.print(" ");   
}   
//inner loop for columns  
for (j=0; j<=i; j++ )   
{   
//prints star      
System.out.print("* ");   
}   
//throws the cursor in a new line after printing each line  
System.out.println();   
}   
}   
}  
Comment

PREVIOUS NEXT
Code Example
Java :: split with multiple condition in java 
Java :: hide app after install android studio 
Java :: set matrix zeros programming creek 
Java :: findone in spring boot 2.4.1 
Java :: print a list java 
Java :: how to plus two numbers in java 
Java :: android bottom navigation hiding views 
Java :: what are method in java 
Java :: Java Type conversion from String to int 
Java :: Array List java can I add a pair of element 
Java :: get imei android programmatically android 10 
Java :: java sort method 
Java :: java spring username encode and decode 
Java :: how to get cpu model number in android programmatically 
Java :: java method overriding 
Java :: java how to change the length of an array 
Java :: what is outer class in java 
Java :: how to find the length of an array in java 
Java :: merging two sorted arrays 
Java :: an internal error occurred during initializing java tooling . java.lang.nullpointerexception 
Java :: like in cypher query 
Java :: get free player inventory slots spigot 
Java :: java code for scientific calculator GUI 
Java :: Java Add Elements to an ArrayList 
Java :: how to check when edittext clicked android 
Java :: java integer division to float 
Java :: org.springframework.security.oauth2.jwt.JwtEncoder 
Java :: java regex for ip address 
Java :: java set font 
Java :: java clear scanner 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =