our lesson is about Flow charting since I am still beginner in this topic I really need your help....
my Problem is
A program that will ask the user to input 3 numbers and determine the minimum number and maximum number
#include <iostream>
using namespace std;
int main ()
{
int mn,mx;
const int Numb = 3;
int a[Numb]; //10 elements
cout<<"Enter 3 values:"; //prompts user for 3 values.
for(int i=0;i<3;i++)
{
cout<< "
Enter value: ";
cin>> a[i]; // puts values in array
}
mn=a[0];
mx=a[0];
for(int i=1;i<3;i++)
{
if(mn>a[i])
{
mn=a[i];
}
else if(mx<a[i])
{
mx = a[i];
}
}
cout<<"Maximum number is: "<< mx << endl;
cout<<"Minimum number is: "<< mn << endl;
system("PAUSE");
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++