Jump to content

Recommended Posts

Posted (edited)

How do I find the total and the average of all values in an array?

*edit* Nevermind...Figured it out.

CODE
#include <Array.au3>

Dim $avArray[11], $I = 1

$total = 0

; Populate test array.

For $I = 1 to UBound( $avArray ) - 1

$avArray[$I] = Int( Random( 1, 2 ) )

$total = $total + $avArray[$I]

Next

_ArrayDisplay( $avArray, "_ArrayToString() Test" )

MsgBox( 4096, "Test", $total)

Exit

Edited by DigitalLocksmith

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...