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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / royal

Thanks Sadik............

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More Core Java Interview Questions

Is a method a procedure?

0 Answers  


What are the supported platforms by java programming language?

0 Answers  


What are the drawbacks of reflection?

0 Answers  


What are the advantages of exception handling?

0 Answers  


what is object slice?

2 Answers   HTC, TCS,






Does java list allow null?

0 Answers  


List out five keywords related to exception handling ?

0 Answers  


What are the 4 types of research methods?

0 Answers  


What is the difference between array and arraylist? what is the difference between arraylist and linkedlist?

8 Answers   EDS, Matrix,


What is meant by stack and queue?

0 Answers   GrapeCity,


What are the types of inner classes (non-static nested class) used in java?

0 Answers  


what is for datainputstream?

1 Answers  


Categories