-1

I have the following code:

#include <iostream>
using namespace std;

int main() {
    string INPUT;
    std::cout << "exp?:" << std::endl;
    std::cout << "[1] r" << std::endl;
    std::cout << "[2] j" << std::endl;
   
    if (INPUT == "1") cout << "how your day[1]good[2] fnef" << std::endl;

    if (INPUT == "1") cout << "good" << std::endl;

    if (INPUT == "2") cout << "2" << std::endl; 
    
    return 0;
}

I want it to be able to take input so I can enter 1 and have it not output both "exp [1]fjrnf [2] fnef" and "test1".

Nick is tired
  • 6,860
  • 20
  • 39
  • 51
  • 3
    Don't learn from videos. [Get a good book](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list?noredirect=1&lq=1). And you're not reading any input; look up `std::cin`. – Stephen Newell Nov 30 '21 at 04:06

1 Answers1

2

Whenever you are going to receive an input, put

std::cin >> INPUT;

All this does is take an input from the user and store it inside INPUT. You should probably put it after each time you want the user to select either good or 2.

Aztro
  • 35
  • 4