Run ❯
Get your
own C#
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
using System; namespace MyApplication { class Program { static void Main(string[] args) { int[] ages = {20, 22, 18, 35, 48, 26, 87, 70}; double sum = 0; foreach (int age in ages) { sum = sum + age; } double average = sum / ages.Length; Console.WriteLine("The average age is " + average); } } }
The average age is 40.75