I need some help, I almost have this figured out for an assignment.
I need to have a program that writes this:
______********
____******
__****
**
__****
____******
______********
The _ is blank space, its suppose to work with what ever integer value I put in, but all I ever get is 7 lines and it looks just like this.
Can anyone see where I am wrong? I have been messing with this for hours, I am by no means a programmer! Any help would be awesome!!!
Code:#include <stdio.h> #include "csc1325.h" int print_line (int x, int y) { while (x >= 1) { printf(" "); x = x - 1; } while (y >= 1) { printf("*"); y = y - 1; } printf("\n"); return 0; } int main (int argc, char * argv[]) { int i; i = 3; while (i >= 0) { print_line(i*2, i*2+2); i = i - 1; } i = 1; while (i <= 3) { print_line(i*2, i*2+2); i = i + 1; } return 0; }



LinkBack URL
About LinkBacks



