How to find Average of Two Numbers in C - Step by Step Examples
How to find Average of Two Numbers in C ?
Answer
To find the average of two numbers in C, you can add the two numbers and then divide the sum by 2.

✐ Examples
1 Average of Two Numbers
In this example,
- We declare two variables 
aandbto store the numbers for which we want to find the average. - We initialize these variables with the desired values.
 - We add the two numbers 
aandband store the sum in a variablesum. - We then divide the 
sumby 2 to calculate the average and store it in a variableaverage. - Finally, we print the value of 
averageto display the average of the two numbers. 
C Program
#include <stdio.h>
int main() {
    int a = 5, b = 10;
    int sum = a + b;
    float average = sum / 2.0;
    printf("Average of %d and %d is %.2f\n", a, b, average);
    return 0;
}Output
Average of 5 and 10 is 7.50
Summary
In this tutorial, we learned How to find Average of Two Numbers in C language with well detailed examples.