Write a preprocessor command that calculates the average of 5 integers.
Difficulty level
This exercise is mostly suitable for students
#include <stdio.h>
#define AVG5(v, w, x, y, z) (((v)+(w)+(x)+(y)+(z))/5)
int main()
{
printf("Value = %d \n",AVG5(1,2,3,4,5));
return 0;
}
Back to the list of exercises
Looking for a more challenging exercise, try this one !!
Common entries in two binary trees