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
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 |
How is java created?
how system.out.println() works?
Define an abstract class with reference to java.
How to know the host from which Applet is originated?
Can you sort a list in java?
does java support pointers?
Write a program to find the whether a number is an Armstrong number or not?
what is sendredirect?
What are the advantages of java over cpp?
How is java hashmap implemented?
Hi Friends, can you give difference between extending thread class and implementing runnable interface.
Define jre i.e. Java runtime environment?