what to put in an IF statement?

D

Delboy

i'm trying a little app for practice, i'm not sure how to do the IF
statement though
i want people to input their option, say their option is stored in INP1.
their options are yes and no
how would you write in a IF statement to execute the block if the word yes
is chosen?

sorry that's the best i can explain it :p
 
I

Ioannis Vranos

Delboy said:
i'm trying a little app for practice, i'm not sure how to do the IF
statement though
i want people to input their option, say their option is stored in INP1.
their options are yes and no
how would you write in a IF statement to execute the block if the word yes
is chosen?

sorry that's the best i can explain it :p


#include <string>

// ...

using namespace std;

// ...

string inp1;

// ...


if(inp1== "yes")
// ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,201
Messages
2,571,049
Members
47,655
Latest member
eizareri

Latest Threads

Top