CSE271: Short Quiz #3 -- C Basics

  1. Write the function prototype (declaration) for a function called cube() that takes one double argument and returns type double. (2 points)

  2. Show how to declare an array of floats in which the first three elements are initialized with the values of 1, .5 and .25. (2 points)

  3. Explain what is wrong with the following seven line function (6 points):
    1   void salami(num)
    2   {
    3     int num, count;
    4
    5     for (count=1; count <= num; num++)
    6        printf("A wonderful sandwich!\n");
    7   }
    


Last revised: 31 January 2013, Brian D. Davison.