Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- int numb,j,space;
- printf("Enter number of lines: \n ");
- scanf("%d", &numb);
- printf("\n");
- while(numb<=1){
- printf("Enter another number:");
- scanf("%d", &numb);
- }
- if(numb>20) numb=20;///sets number greater than 20
- for(j = 1; j <= numb; j++)
- {
- printf("*");
- for(space = 1; space < j; space++)
- {
- printf(" ");
- }
- printf("*\n");
- }
- for(j = 1; j <= numb; j++)
- {
- printf("*");
- for(space = numb; space > j; space--)
- {
- printf(" ");
- }
- printf("*\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement