c program to find average of 3 numbers

Solutions on MaxInterview for c program to find average of 3 numbers by the best coders in the world

showing results for - "c program to find average of 3 numbers"
Jesús
26 Aug 2020
1#include <stdio.h>
2
3int main(void) 
4{
5  // these numbers can be whatever you want
6  int number = 1231231;
7  int number2 = 1231232;
8  int number3 = 1;
9  
10  // add up all the numbers you want to average, then divide it by the total amount of numbers. In this case there are 3 numbers, so you divide it by three.
11  int average = number + number2 + number3 / 3;
12    
13  // prints the average
14  printf("%i", average);
15}