Puzzle T5

array of 10 bulb structs

Array Declaration

Write a main() that declares an array of 10 Bulb structs and initializes the first several to interesting values. Initialize the members of the remaining bulbs to zero. Print the array to show that your initializations have worked.

#include <stdio.h>

struct Bulb
{
  int watts;
  int lumens;
};

/* function to print a Bulb */
void printBulb( struct Bulb b )
{
}

int main()
{
  /* declare an array of 10 Bulbs */

  /* zero all Bulbs */

  /* initialize several Bulbs */

  /* print values of Bulbs */
  
  return 0;
} 


Previous Page        Answer         Next Page         Home