Friday, 15 May 2015

C Program To Print Chess Board

Problem Statement: Write a program in c that will print the chess board. Enter a number to print the board.



#include<stdio.h>
#include<conio.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("\xDB");
             printf(" ");
           }
             printf("\n");
             if(i%2==0)
             {
                printf(" ");
             }
        }
 getch ();
 return 0;
}


Related Posts:

  • C Program To Print Chess Board Problem Statement: Write a program in c that will print the chess board. Enter a number to print the board. #include<stdio.h> #include<… Read More
  • C code to implement stack Problem Statement: Write a program in c language to implement stack operation. i) Push ii) Pop iii)Top iv) Display Code: #include<conio.h> … Read More
  • Binary Search In C Problem Statement:  write binary search code in c, that will search for the number in array and find output if the number is found and also … Read More
  • Program To Print Factorial In C Problem Statement: Write a program in c that will print the factorial of a given number using for loop. #include<stdio.h> #include<conio… Read More
  • Semester Project For C Language Here is a letter guessing game in c language. You can use this code as your semester project. First enter the word and your name. It will ask you w… Read More

2 comments: