G03 Answer


#include <stdio.h>

struct Bulb
{
  int watts;
  int lumens;
};

/* function to print a Bulb */
void printBulb( struct Bulb b )
{
  printf("watts = %d\tlumens = %d\n", b.watts, b.lumens );
}

int main(int argc, char *argv[])
{
  /* declare and initialize two Bulbs */
  struct Bulb bulbA, bulbB;
  
  bulbA.watts = 100; bulbA.lumens = 1710;
  bulbB.watts =  60; bulbB.lumens = 1065;

  /* print values of both Bulbs */
  printBulb( bulbA );
  printBulb( bulbB );
    
  system("PAUSE");	
  return 0;
} 

Comments: