Wednesday, January 26, 2022

Largest of Five Numbers in C++

 A program that will ask the user to give five numbers and then the program will determine which of the five numbers has the largest numerical value using a C++ programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.


Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg






Program Listing

// minmax_element #include <iostream> // std::cout #include <algorithm> // std::minmax_element #include <array> // std::array int main () { int a=0,b=0,c=0,d=0,e=0; std::cout <<"\n\n"; std::cout <<"\tLargest of Five Numbers in C++"; std::cout <<"\n\n"; std::cout << "\tGive five numbers : "; std::cin >> a >> b >> c >> d >> e; std::array<int,5> foo {a,b,c,d,e}; auto result = std::minmax_element (foo.begin(),foo.end()); std::cout <<"\n\n"; std::cout << "\tThe Largest Number : " << *result.second; std::cout <<"\n\n"; std::cout << "\tEnd of Program"; std::cout <<"\n\n"; return 0; }

No comments:

Post a Comment