Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int rows, star, space;
  7. int number_of_stars;
  8. int number_of_rows;
  9.  
  10. printf("Enter number of stars(rows): ");
  11. scanf(" %d", &number_of_stars);
  12.  
  13. number_of_rows = number_of_stars;
  14.  
  15. for(rows = 1; rows <= number_of_rows; rows++){
  16. for(space = 1; space <= number_of_stars; space++){
  17. printf(" ");
  18. }
  19. for(star = 1; star <= rows; star++){
  20. printf("*");
  21. printf(" ");
  22. }
  23. printf("\n");
  24. number_of_stars = number_of_stars - 1;
  25. }
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement