Asks user to specify five integers, finds the smallest one, and then displays the result to the screen

Asks user to specify five integers, finds the smallest one, and then displays the result to the screen

Solution :
Input Screen
#include
using namespace std;
int main()
{
//declare the variables
int a, b;
int smallest;
//display enter the two numbers
cout << "Enter the two numbers : \n"; // enter the value of a cin >> a;
//enter the value b
cin >> b;
//using condition
smallest = b > a ? a : b;
// the output will be here
cout << "The smallest one is : " <

Output screen

Leave a Comment

Your email address will not be published. Required fields are marked *