I'm new to all this C programming. and I have this work I must do But I'm stuck at a point and have no idea how to continue..
that's the assignment : http://www.cs.bgu.ac.il/~prog111/wik...ssignment1.pdf I only made it till the 2 step and I could not figure out how to do it...
that's my code so far:
I'm only allowed to do it with these functions: IF, IF ELSE, CONTINUE, BREAK, FOR, WHILE, DO WHILE.Code:#include <stdio.h> #define printStart printf("Please enter the width of your square, the max num of chars per line, and the max num of lines:\n") #define printTchau printf("Good Bye!\n") #define printMinus printf("-") #define printPlus printf("+") #define printSpecialFrame printf("@") #define printNormalFrame printf("#") #define printNewLine printf("\n") int main(){ //write your code here int width,length,numline;//width- size of a square,length- the max number of chars per line,numline-number of lines int i,j,k,n; do { printStart; scanf("%d%d%d", &width,&length,&numline); } while((width<=0)||(length<=0)||(numline<=0)); for (i=0; i<width ;i++) { for (j=0; j<width-i; j++) { printPlus; } for (k=j; k<width; k++) { printMinus; } printNewLine; } printTchau; //end of code return 0; }
Please Help!!
Thank you!



LinkBack URL
About LinkBacks





Because Tetris Is Unrealistic.
