Lab 9
Lab 9
Lab 9
h>
//function definition
void largest()
{
//getting the elements from the user
printf("Enter the number of values to be stored in array : \n");
scanf("%d",&num);
printf("Input 5 elements in the array : \n");
void average()
{
//finding the average of values in array
for( int i = 0; i < num; i++)
{
total = total + arr[i];
}
printf("The average is: %.2f\n",total /(float)num);
}
int main()
{
//function calling
largest();
average();
return 0;
}