void checker(int width,int height){
int horizontal;
int repeat;
int i;
int j;
for(j=1; j<=height; j++){
while(horizontal<=width){
repeat = width/10;
if(horizontal%2){
for(i = 1; i <=repeat; i++)
printf("1");
}
else{
for(i = 1; i <=repeat; i++)
printf("0");
}
horizontal++;
}
printf("\n");
}
}
int main(){
checker(20,10);
return 0;
}
So I'm creating a pattern through C. As you can tell from my code, I'm barely getting the hang of C. As I compile and test this the pattern doesn't print out in 0's and 1's, rather it only prints the \n.
I was wondering why, I might be having a brain fart.
Thank you for the time, it's very appreciated from new comers like me!
gcc -Wall -Wextra -gif using GCC...). Learn to use the debugger (gdb)