C Program To Print Chess Board

#include<stdio.h>

int main()

{

    int i,j,num;

    printf("Enter the number : ");

    scanf("%d",&num);

    for(i=0;i<num;i++)

    {

        for(j=0;j<=num;j++)

        {

            printf("%c",219);//219 is the ASCII cose for white

            printf(" ");

        }

        printf("\n");

        if(i%2==0)

        {

            printf("%c",255);//255 is the ASCII cose for white

        }

    }

    return 0;

}

OUTPUT

C Program To Print Chess Board

Share To:
Next
Newer Post
Previous
This is the last post.

Arogya Thapa Magar

Post A Comment:

0 comments so far,add yours