Created
November 13, 2024 15:32
-
-
Save dontpaniclabsgists/fbcbc1a4fe1eab4df7c39e9a0bfc00dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numbers: number[] = [85, 90, 78, 92, 88]; | |
let total = 0; | |
let count = numbers.length; | |
let i = 0; | |
do { | |
total += numbers[i]; | |
i++; | |
} while (i < count); | |
let average = total / count; | |
console.log("Average:", average); //Output is 86.6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment