Puzzle E12

Intermediate Results

As always, operations are performed in order of precedence.

Operands are promoted as needed so each operation is perfomed between operands of the same type.

Intermediate results during evaluation may be of a lower type than the final expression.

What is displayed by this program:

#include <stdio.h>

/* Puzzle E12 -- sneaky intermediate */
int main()
{
  int a = 7;
  int d = 3;
  
  printf("Expression evaluates to: %f\n", a/d + 1.0 );   
  return 0;
}


Previous Page        Answer         Next Page         Home