Thursday, October 18, 2012

Square shape using * and _

OutPut:-

______*______
_____*_*_____
____*_*_*____
___*_*_*_*___
__*_*_*_*_*__
_*_*_*_*_*_*_
Code :-
#include <stdio.h>
main() {
    int i,j,n;
    printf("Enter No of lines to be printed");
        scanf("%d",&n);
        printf("\n");   
    for(i=0;i<n;i++) {
        for(j=n-i;j>0;j--) {
            printf("_");
        }
        for(j=0;j<((2*i)+1);j++) {
            if(j%2 == 0) printf("*"); else printf("_");
        }
        for(j=n-i;j>0;j--) {
            printf("_");
        }
        printf("\n");
    }
        printf("\n");
}

1 comment:

  1. Is bwin no deposit bonus code for 2021? - DrmCD
    Bwin No Deposit Bonus Codes List 2021 — We have been tracking the bwin no deposit bonus codes since 2004 포항 출장안마 and found 고양 출장샵 that 서귀포 출장샵 Bwin was the first casino to 거제 출장샵 offer a 안성 출장안마

    ReplyDelete