fork download
  1. #include <stdio.h>
  2.  
  3. int main(){
  4. int n;
  5. printf("Enter the number: \n");
  6. scanf("%d",&n);
  7. for(int i=1;i<=n;i++){
  8. for(int j=1;j<=n;j++){
  9. if(j==(n+1)/2|| i==(n+1)/2)
  10. printf(" * ");
  11. else printf(" ");
  12. }
  13. printf("\n");
  14. }
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0.01s 5332KB
stdin
11
stdout
Enter the number: 
                *                
                *                
                *                
                *                
                *                
 *  *  *  *  *  *  *  *  *  *  * 
                *                
                *                
                *                
                *                
                *