lundi 28 décembre 2015

IF command to check if input is string

#include "iostream"
using namespace std;


int main(){
    int quantity;
    cout<<"What Quantity did u receive : \n";
    cin >> quantity;
    if (quantity != int){
        cout << "please use numerical values only!\n";
    }
}

please i want to verify the correct IF command for the 'if statement' int the above code, thank you

Aucun commentaire:

Enregistrer un commentaire