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 do you sing an Applet ?
Why is stringbuffer not immutable?
Explain JMS in detail.
Explain what are final variable in java?
Can we override final method?
What is the difference between I ++ and ++ I in java?
How do you do descending order in java?
Why is whitespace important?
Which list is sorted in java?
how many access specifiers are available in java
Why destructor is not used in java?
What does the ‘static’ keyword mean? Is it possible to override private or static method in java?