star printing in descending order

star printing in descending order


Star printing in descending order

import java.util.*;
class star2
{
    public static void main()
    {
        int a,b,c;
        Scanner sc=new Scanner(System.in);
        System.out.print("Enter you how much row column you want : ");
        c=sc.nextInt();
        for (a=c;a>=1;a--)
        {
            for (b=1;b<=a;b++)
        {
        System.out.print("*");
    }
    System.out.println("");
    }
}
}

OUTPUT
star printing in descending order

Post a Comment

0 Comments