63 132
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #16092 in C++ for Joni Davis

Question #16092
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
Expert's answer
#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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions