Professional Documents
Culture Documents
1/
using System;
int[] arr = { 1, 2, 6, 2, 18 };
int i=0;
int sum = 0;
sum += arr[i];
}
average = (float)sum / arr.Length;
using System;
int[] array = { 1, 2, 3, 4, 5 };
int item = 4;
if (index != -1) {
else {
6. Find the maximum value of the array And 7.Find the minimum value of the array
using System;
n= Convert.ToInt32(Console.ReadLine());
for(i=0;i<n;i++)
arr1[i] = Convert.ToInt32(Console.ReadLine());
mx = arr1[0];
mn = arr1[0];
if(arr1[i]>mx)
mx = arr1[i];
}
if(arr1[i]<mn)
mn = arr1[i];
7. Quit
2/