Check the Speed

less than 1 minute read

The code has been modified slightly and now uploaded to the site.

Question

<— Return Home

34.cpp

#include <iostream>
using namespace std;

int main(){
    double speed;

    std::cout << "Enter the speed of the vehicle: \n";
    std::cin >> speed;

    if (speed < 20){
        std::cout << "Too slow\n";
    }
    else if (speed > 80){
        std::cout << "Too fast\n";
    }
    else {
        std::cout << "Just right\n";
    }
}

<— Return Home