Uploaded by Hernani Nobuo Ike

HernaniIke Pattern0

advertisement
#include <stdio.h>
#include <math.h>
int main() {
int width, height;
printf("Digit the width of your matrix: \n");
scanf_s("%d", &width);
printf("Digit the height of your matrix: \n");
scanf_s("%d", &height);
const int r = width;
const int c = height;
//double matrix[3][3];
for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
if (row % 2 == 0 || (row % 2 == 1 && col % 2 == 0)) {
printf("* ");
}
else if(col % 2 == 1){
printf("0 ");
}
}
printf("\n");
}
int stop;
scanf_s("%d", &stop);
return 0;
}
Download