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 |
Is void a return type?
What is java dot?
Is array size fixed in java?
Why only one Class is public in one file? Explain in details. Thanks in Advance.
Is void a data type in java?
What is a dynamic array java?
How can u increase the heap size in the memory?
explain the concept of inheritance with an example?
How objects are stored in java?
What is array size in java?
Is a class subclass of itself?
Lowest Common ancestor in a Binary Search Tree and Binary Tree.