Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- int main()
- {
- std::string name;
- int ans;
- char response;
- std::cout << "Hello User, Enter your Name.\n ";
- std::cin >> name;
- std::cout << "Hello " << name
- <<". It was nice to know your name!\n";
- std::cout<<"\nDo you want to solve a math problem?(Y/N)\n";
- std::cin>> response;
- if (response == 'Y')
- {
- std::cout<<"What is 10 + 10?\n";
- std::cin>>ans;
- if (ans == 20)
- {
- std::cout<<"Fabulous!! \nHave a Wonderful day";
- }
- else
- {
- std::cout<<"Wrong answer!! \nWork hard, Have a Wonderful day";
- }
- }
- else
- {
- std::cout<<"Okay fine!,Have a Wonderful day";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment