training

Code I wrote during training
git clone git://git.bitsmanent.org/training
Log | Files | Refs | README

getsquare.c (367B)


      1 /* Esercizio 5.19 */
      2 
      3 void square(int);
      4 
      5 int main()
      6 {
      7    int n;
      8 
      9    printf("Give me the side: ");
     10    scanf("%d", &n);
     11 
     12    square(n);
     13 
     14    return 0;
     15 } /* E0F main */
     16 
     17 /* Print a square of "side" size */
     18 void square(int side)
     19 {
     20    int i, j;
     21 
     22    for(i = side; i >= 1; i--) {
     23       for(j = side; j >= 1; j--)
     24 	 printf("*");
     25       printf("\n");
     26    }
     27 
     28 } /* eof square() */
     29