Write a program that prompts the user to input four Integers and then Display which Number is Greater and which one is Smaller
1
Expert's answer
2013-04-17T11:28:03-0400
#include <iostream> #include <algorithm> #include <vector> using namespace std;
int main (){ cout<<"Enter four numbers, please...\n";
vector<int> numbers;
int temp;
for (int i = 0 ; i < 4 ; i++){ cin>>temp; numbers.push_back(temp); } cout<<"The greatest of the numbers is: "<<*max_element(numbers.begin(),numbers.end())<<endl; cout<<"The smallest of the numbers is :"<<*min_element(numbers.begin(),numbers.end())<<endl;
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment