Puzzle E20

Math to C

Complete the following program so that it evaluates this formula:

x plus y over two c
#include <stdio.h>

/* Puzzle E20 -- math to C */
 
int main()
{
  double x = 12.3, y = 7.2, c = 3.2;
  double result;
  
  result =  ;  /* Complete this statement */
  
  printf("result: %f\n", result ); 
  return 0;
}

Hint: You will get this wrong.



Previous Page        Answer         Next Page         Home