Answer to Question #5377 in C++ for Naveed Qurban
Make program that prints minimum and maximum of 10 numbers. Note that you cannot use 10 input variables. You should use loops for the purpose.
float a, min, max;
& cout<<"Enter a number "<<i+1<<": ";
min = a;
max = a;
& if (a[i]>max) max = a[i];
& if (a[i]<min) min = a[i];
cout<<"Minimum is "<<min<<"\n"<<" Maximum is "<<max;
No comments. Be first!