Puzzle E19

Associativity of +

If there are several arithmetic operators of the same precedence, they are evaluated left to right. (Some other operators are evaluated right to left. Be careful!)

Complete the following silly program so that it writes: "Goodbye Cruel World"

#include <stdio.h>

/* Puzzle E19 -- associativity of + */
int fun04()
{
  printf(" World\n");
  return 4;
}

int fun03()
{
  printf(" Goodbye \n");
  return 3;
}

int fun07()
{
  printf(" Cruel \n");
  return 7;
}

int main()
{
  int result;
  
  result =   ;  /* Complete this statement */
  
  return 0;
}


Previous Page        Answer         Next Page         Home