0

Can somebody help in this code

ı want this code to do of you write potato it sais it is a potato and if you don't say potato like Apple or orange or potat things are not potato it will say it is not a potato https://code.sololearn.com/cftQFKqSJKi5/?ref=app

29th Aug 2017, 6:09 PM
Mert
Mert - avatar
2 Réponses
+ 13
#include <string> #include <iostream> using namespace std; int main() { string a = "is a potato"; string b = "is not a potato"; string word; cin >> word; if (word == "potato") cout << a; else cout << b; return 0; } • You forgot semicolons. • Input "word" must be a string. • String "potato" needs quotes. • The "if condition" needs parentheses.
29th Aug 2017, 6:23 PM
Maz
Maz - avatar
+ 1
thank you very much for your help
29th Aug 2017, 8:17 PM
Mert
Mert - avatar