Pattern 11 from practice questions

not able to get it how the element between start get replaced by space

Hey @amansinghc33 Send me your code.

package Lecture1;

import java.util.Scanner;

public class Patterna9 {

public static void main(String[] args) {
	// TODO Auto-generated method stub
	Scanner sc= new Scanner(System.in);
	System.out.println("enter the no ");
	int n=sc.nextInt();
	int nsp=n-1;
	int cst=1;
	for(int i=0;i<n;i++) 
	{
		for(int csp=1;csp<=nsp;csp++)
		{
			System.out.print(" ");			
		}
		for(int nst=1;nst<=cst;nst++)
		{
			System.out.print("*");
		}
		System.out.println();
		nsp--;
		cst=cst+2;
		
	}
}

}

sir i can print the pattern but not able to make logic for getting space between stars.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

not to able to get how to put exclamatory mark