Hollow rhombus pattern

GETTING SLIGHTLY DIFFERENT PATTERN
PLEASE CHECK MY CODE WHERE I AM DOING WRONG
CODE IS IN THE BELOW LINK

@sk3657860 hey sonu this problem is quite easy all you need to do apply a loop of n*n matrix and give the condition if(i==1||i==n||j==1||j==n) cout<<" * " else cout<<" ";
and shifting of the square do n-i spaces.