UNB/ CS/ David Bremner/ teaching/ old/ cs2023/ events/ CS2023 Assignment 1

If you have not completed the introductory tutorial yet, I recommend you do that first to get familiar with the Linux/C programming environment.

  1. (10 Marks) Write a C program to solve programming project 7 on page 34 of the course text. Test your program carefully, and hand in a typescript of your testing.

  2. (20 Marks) Write a C program that generates the following picture. Your program must use two nested loops, and at most two printf statements. Hint: the horizontal offset is r*r/6 at row r.

*
*
*
 *
  *
    *
      *
        *
          *
             *
                *
                    *
                        *
                            *
                                *
                                     *
                                          *
                                                *
                                                      *
                                                            *