C Program to Calculate Average

With the help of C programming, we can easily solve various mathematical problems like division, multiplication, etc. In this tutorial, we are going to write a C program to find the average of numbers.

c program to add two numbers using pointers

How to Calculate Average in C Programming

The logic for calculating the average of numbers is simple. We will ask users to enter the count of the numbers they want to average after that we ask the users to enter each number. After that, we will calculate the sum of the numbers and divide the sum by the count of the numbers.

C Program to Calculate Average

Let’s write a C program to calculate the average of given numbers.

Output

C Program to Calculate Average

This is a simple approach to calculating the average of n numbers using a C program, by using the same logic we can also calculate the average of n numbers in other programming languages like C++, Java, Python, Rust, etc.

Happy Coding

See Also

2 thoughts on “C Program to Calculate Average”

Leave a Comment