Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int rows, star, space;
- int number_of_stars;
- int number_of_rows;
- printf("Enter number of stars(rows): ");
- scanf(" %d", &number_of_stars);
- number_of_rows = number_of_stars;
- for(rows = 1; rows <= number_of_rows; rows++){
- for(space = 1; space <= number_of_stars; space++){
- printf(" ");
- }
- for(star = 1; star <= rows; star++){
- printf("*");
- printf(" ");
- }
- printf("\n");
- number_of_stars = number_of_stars - 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement