#include <iostream> 
using namespace std;

int main(){
    int maxVal, minVal, num;

    for(int i=0; i < 4; i++){
        cout << "Digite um valor:" << endl;
        cin >> num;
        
        if(i==0){
            maxVal = num;
            minVal = num;
        }
            if(num > minVal){
              maxVal = num;
            }
            if(num < minVal){
                minVal = num;
            }
        }
            
            cout << "Menor eh: " << minVal << " Maior eh: " << maxVal << endl;
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: