Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. int main()
  2. {
  3. int numb,j,space;
  4.  
  5. printf("Enter number of lines: \n ");
  6. scanf("%d", &numb);
  7.  
  8. printf("\n");
  9.  
  10. while(numb<=1){
  11. printf("Enter another number:");
  12. scanf("%d", &numb);
  13. }
  14.  
  15.  
  16. if(numb>20) numb=20;///sets number greater than 20
  17. for(j = 1; j <= numb; j++)
  18. {
  19. printf("*");
  20. for(space = 1; space < j; space++)
  21. {
  22. printf(" ");
  23. }
  24. printf("*\n");
  25. }
  26.  
  27.  
  28. for(j = 1; j <= numb; j++)
  29. {
  30. printf("*");
  31. for(space = numb; space > j; space--)
  32. {
  33. printf(" ");
  34. }
  35. printf("*\n");
  36. }
  37.  
  38.  
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement