I wrote this using devc++ and it ran properly on windws but when i ran it using solo learn it skipped some of the stages, help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I wrote this using devc++ and it ran properly on windws but when i ran it using solo learn it skipped some of the stages, help

int main() { cout << "Hello my name is Ai what's yours?\n"; cout << "Name:"; string name; cin >> name; cout << "Hello " << name << " How many years old are you?" << "\n"; int age; cin >> age; if (age > 0 ) { cout << "so " << name << " you are " << age << " years old."; } if (age < 0) { cout << "i am pretty sure toddler cant answer my questions"; } } return0; }

9th Feb 2017, 12:49 PM
Caul:
Caul: - avatar
2 Answers
+ 6
Code Playground is an online compiler, meaning that separate inputs needs to be all mashed up into one and sent to the compiler. It doesn't work like a console. Bottom line, it's not your problem. But ffs, please ditch \n and use endl. Declare all variables at the beginning of the program instead of declaring them right before you need them. And I believe even toddlers start from the age of 0 and not below that...
9th Feb 2017, 3:03 PM
Hatsy Rei
Hatsy Rei - avatar
0
thanks for the help
9th Feb 2017, 3:09 PM
Caul:
Caul: - avatar