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

What is basic syntax?

1053


Can a string be null?

995


Why stringbuilder is not thread safe in java?

1022


Explain listiterator and methods in listiterator?

1027


Explain about procedural programming language or structured programming language and its features?

1107


Can we make main() thread as daemon?

1118


How do I start learning java?

1080


Is java ee a framework?

996


Have you ever used hashtable and dictionary?

1022


What is a copy constructor in java?

1131


Is java a prime method?

993


Is empty .java file name a valid source file name?

1130


What invokes a thread's run() method in java programming?

1200


What is jar?

1130


What is a function easy definition?

1017