mardi 21 juin 2016

What changes should I do so that when I enter "a" its says bread and when I enter "b" it says wine?

Here is my code. The formula I entered on my if statement doesn't work.

#include <iostream>
using namespace std;

int main(){

    int value;

    cout << "a) Bread" << endl;
    cout << "b) Wine" << endl;
    cout << endl;
    cout << "Please enter the letter of the type of product you want to buy: " << endl;
    cin >> value;

    if(value == a){
        cout << "You chose bread";
    } else{
        cout << "You chose wine";
    }

    return 0;
}

Aucun commentaire:

Enregistrer un commentaire