Answer to Question #345222 in C++ for Ali

Question #345222

Input 10 numbers, and display smallest number


1
Expert's answer
2022-05-26T09:14:02-0400
#include <iostream>
#define INT_MAX 2147483647
using namespace std;


int main()
{
    int smallest = INT_MAX; 
    int temp;
    for(int i = 0; i<10; i++){
        cin>>temp;
        if(temp<smallest)
            smallest = temp;
    }
    cout<<smallest;
    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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS