Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Hi friends i want display Triangle shap stars(*) please can
tell me any one java code logic?
*
***
*****
******* Like this

Answer Posted / sadikhasan palsaniya

public class Test{
public static void main(String var[]){
int c=1;
for(int i=1;i<=4;i++){
for(int k=4;k>=i;k--)
System.out.print(" ");
for(int j=1;j<=c;j++){
System.out.print("*");
}
System.out.println("");
c=c+2;
}
}
}

Is This Answer Correct ?    14 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can a gui component handle its own events in java programming?

1082


Explain the private protected method modifier?

1030


What is a newline character in java?

1088


When do I need to use reflection feature in java?

1138


what is the difference between future and callable interface in java?

1316


Does java isempty check for null?

1040


How to optimize the javac output?

1094


How many types of memory areas are allocated by jvm?

1086


What is meant by overloading?

1123


Does apple use java?

1000


Why do we need variables?

1034


What is cr keyboard?

1344


How do you compare two strings lexicographically?

979


What is variable in java?

1047


Can a class with private constructor be extended?

1001