Advertisement
S_h_u_v_r_o

pattern2

Oct 26th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. /*
  2. ****
  3. * *
  4. * *
  5. **** */
  6.  
  7. #include<stdio.h>
  8. int main()
  9. {
  10. int a,b,c,d,x;
  11. scanf("%d",&x);
  12. d=x-2;
  13. for(a=0;a<x;a++)
  14. {
  15. if(a==0||a==(x-1))
  16. {
  17. for(b=0;b<x;b++)
  18. {
  19. printf("*");
  20. }
  21. }
  22. else
  23. {
  24. printf("*");
  25. for(b=0;b<d;b++)
  26. {
  27. printf(" ");
  28. }
  29. printf("*");
  30. }
  31. printf("\n");
  32. }
  33.  
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement