In this assignment you will write a small C program to a) receive integer values
ID: 3653640 • Letter: I
Question
In this assignment you will write a small C program to a) receive integer values from the user, and store those values as an array, b) compute the minimum, c) maximum and d) average value. The program will display a menu with the following options: 1) Enter a new set of values 2) Find the minimum value entered 3) Find the maximum value entered 4) Find the average value 5) Exit The program should accept up to 10 values. If user select a number from 1-4, a function should be called. All these functions should receive at least two parameters a) an array of integers, and b) the size of the array. Option 2 and 3 must return an integer value, while option 4 must return a float data type.Explanation / Answer
#include<stdio.h>
#include<conio.h>
void main();
int a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,avg;
clrscr();
{
Printf("Plesase enter 1st value");
Scanf("%D",&a1);
Printf("Plesase enter 2nd value");
Scanf("%D",&a2);
Printf("Plesase enter 3rd value");
Scanf("%D",&a3);
Printf("Plesase enter 4th value");
Scanf("%D",&a4);
Printf("Plesase enter 5th value");
Scanf("%D",&a5);
Printf("Plesase enter 6th value");
Scanf("%D",&a6);
Printf("Plesase enter 7th value");
Scanf("%D",&a7);
Printf("Plesase enter 8th value");
Scanf("%D",&a8);
Printf("Plesase enter 9th value");
Scanf("%D",&a9);
Printf("Plesase enter 10th value");
Scanf("%D",&a10);
if(a1>a2,a3,a4,a5,a6,a7,a8,a9,a10)
Printf("a1 is the greatest");
if(a2>a1,a3,a4,a5,a6,a7,a8,a9,a10)
Printf("a2 is the greatest");
if(a3>a2,a2,a4,a5,a6,a7,a8,a9,a10)
Printf("a3 is the greatest");
if(a4>a2,a3,a1,a5,a6,a7,a8,a9,a10)
Printf("a4 is the greatest");
if(a5>a2,a3,a4,a1,a6,a7,a8,a9,a10)
Printf("a5 is the greatest");
if(a6>a2,a3,a4,a5,a1,a7,a8,a9,a10)
Printf(6a1 is the greatest");
if(a7>a2,a3,a4,a5,a6,a1,a8,a9,a10)
Printf("a7 is the greatest");
if(a8>a2,a3,a4,a5,a6,a7,a1,a9,a10)
Printf("a8 is the greatest");
if(a9>a2,a3,a4,a5,a6,a7,a8,a1,a10)
Printf("a9 is the greatest");
if(a10>a2,a3,a4,a5,a6,a7,a8,a9,a1)
Printf("a10 is the greatest");
avg=(a1+a2+a3+a4+a5+a6+a7+a8+a9+a10)/10;
Printf("the average of the numbers is %d",avg);
getch();
}