Question #13468

Write a program to insert any ten numbers and find minimum and maximum numbers.

Expert's answer

# include<iostream.h>

# include<conio.h>

void main(){

float a[10], min;

int i;

for (i=0;i<=9;i++){

& cout<<"Enter a number "<<i+1<<": ";

& cin>>a[i];

}

min = a[0];

for (i=0;i<=9;i++) if (a[i]<min) min = a[i];

cout<<"Minimum is "<<min;

getch();

}

# include<conio.h>

void main(){

float a[10], min;

int i;

for (i=0;i<=9;i++){

& cout<<"Enter a number "<<i+1<<": ";

& cin>>a[i];

}

min = a[0];

for (i=0;i<=9;i++) if (a[i]<min) min = a[i];

cout<<"Minimum is "<<min;

getch();

}

## Comments

## Leave a comment