![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0bmcEVWdfyxmTewAoV1hKYtRLVI0IfBZqT8CQ2dmc8BmsZY122dmYiFb1s3b-1hdC31Hfp_spY_dETZB4-5b41bo78wdQ-gaDQb0TOz3rpzLfFa3bfMI9altcziih0CAB2h888XW3pMRn/s320/width1000_Java_Software.jpg)
public class Stars{
public static void main(String args[]){
int c=1;
for(int i=1;i<=5;i++)
{
for(int j=i;j<5;j++)
{
System.out.print(" ");
}
for(int k=1;k<=c;k++)
{
if(k%2==0)
System.out.print(" ");
else
System.out.print("*");
}
System.out.println();
c+=2;
}
}
}
0 comments:
Post a Comment