Starting code and condition you are required to use nested loops to generate the following patterns.
#include <stdio.h>
#include <math.h>
void DrawPattern(int w, int h, int radius) {
int i=0, j=0, hw = w/2, hh = h/2;
for(j=0;j<h;++j) {
for(i=0;i<w;++i) {
//add code here
}
}
}
int main() {
DrawPattern(15, 15, 7);
return 0;
}
Aucun commentaire:
Enregistrer un commentaire