The question: Get an integer value from the user to draw a cheassboard on the screen of that specified size. The black squares must be * and with any other chessboard there must always be a *(black square) in the bottom left corner.
PLEASE NOTE: I'm very new to c++ programming.
My problem now is every un-even number it shows the * in the bottom left corner but if i input an even number it gives a blank space(white square) in the lower left corner....?
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int num1;
int n = 1, k = 1 ;
cout << "Enter Checkered board size: " ;
cin >> num1;
cout << "\n\n";
while(n <= num1)
{
k = 1 ;
if ( n++ % 2 == 0) cout << ' ' ;
{
while(k++ <= num)
{
cout<<"* " ;
}
cout << "\n\n" ;
}
}
cout << "\n\n";
system("PAUSE");
return 0;
}