Answer T11

#include <stdio.h>

typedef struct
{
  int watts;
  int lumens;
} Bulb;

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

int main()
{
  /* declare and initialize two Bulbs */
  Bulb bulbA, bulbB;

  bulbA.watts = 100; bulbA.lumens = 1710;
  bulbB.watts =  60; bulbB.lumens = 1065;

  /* print values of both Bulbs */
  printBulb( bulbA );
  printBulb( bulbB );

  return 0;
}


Back to Puzzle Home