class Stars
{
public static void main(String args[])
{
int c=1;
for(int i=1;i<=10;i++)
{
for(int k=1;k<=c;k++)
{
if(k%2==0)
System.out.print("*");
// else
// System.out.print("*");
}
System.out.println();
c+=2;
}
output:
*
**
***
****
*****
******
*******
********
*********
i cannot understand that what the function of variable "c" and how it print star by increment.can someone explain it to me.