average calculator

1. make an array nums[number of neumbers you will calculate the average of] 
   wich will store the numbers and a variable sum=0 (make it double)
2. input that array with a loop 
3. in the loop, after you have entered nums[i] add it to sum
4. after loop output sum divided by the number of numbers

code in c++:

#include <iostream>

using namespace std;

int main()
{
	long long nums[ 5 ];  // I used 5 cus I like the number 5. 
                          //Could have been 3 or 10 or whatever.
    double sum = 0;
    
    for( long long i = 1 ; i <= 5 ; i++ )
    
    {
    
    	cin >> nums[ i ];
        
        sum += nums[ i ];
    
    }
    
    cout << sum / 5 << endl ;
    
    return 0;
    
    }

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
numbers average calculator find average calculator average calulation how to cakculate average average value calculus calulate average online calculator average calculate average online average finder online average numbers calculator average calcular online average count find the average how to find an average average value of function calculator calculating the average find the average value of the function calculator calculate average date a calculator for average average of function calculator average calcualtor calculate average amount average find average value of a function calculator online average calculator formula to calculate average find the average calulator average in calc how to calcukate average calculate average from numbers average of numbers calculator different ways to calculate average how to calculate average number how do we find average how to calculate average of a number how calculate an average average value of a function calculator calculating average function average calculator arithmetic average return calculator average value calculator find average caluclator average value of fuinction calculator average caluclator average calc caculate average how do you calculate average formula used to calculate average average caculator average calulator average calculatoion how to calculate an average how find average how calculate average how to calculate average calculate the average average calculator online how to calculate average amount Find the average calculator how to calculate a average number how to find the average calculate average how to calculate the average find average average online average finder how to find average average calculator
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source