-1
#include <stdio.h>

int main(){

    int i,j,k=1;

    int loop_count = 10;

    for(i=1;i<loop_count;i++){

        if( i > 1){

            for(j=0;j<i+k;j++){
                if( i == 2 )
                    printf("*");
                else{
                    if( j%k == 0)
                        printf("*");
                    else
                        printf(" ");
                }
            }
            k++;
        }else
            printf("*");

        printf("\n");
    }

    return 0;
}
Attachments 23.png 0.91 KB
3
Contributors
4
Replies
32
Views
2 Years
Discussion Span
Last Post by dbfud1988
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.