Help with code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
using namespace std;
int main()

{
   char response;
   cout<< "Are you having a good day?"<<endl;
   cin>>response;

   if (response == 'Y')
   {
       cout<<"Thats good to hear!"<<endl;
   }
   else if (response == 'N')
   {
       cout<<"Thats too bad..."<<endl;
       cout<<"Is there anything I can do?"<<endl;
   }

return 0;
}


When i put 'cout<<"Is there anything I can do?"<<endl;' how would i make it to where i could make another responce?[/code]
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
using namespace std;
int main()

{
   char response;
   cout<< "Are you having a good day?"<<endl;
   cin>>response;

   if (response == 'Y')
   {
       cout<<"Thats good to hear!"<<endl;
   }
   else if (response == 'N')
   {
       cout<<"Thats too bad..."<<endl;
       cout<<"Is there anything I can do?"<<endl;
       cin >> response;
       if (response == 'Y')
      {
          cout<<"What can i do?"<<endl;
       }
       else if (response == 'N')
      {
         cout<<"So there's nothing I can do" <<  endl;
       }
   }
return 0;
}
Topic archived. No new replies allowed.