Pls help me with this code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Pls help me with this code

#include <iostream> using namespace std; int main() { int a; cout << "Please enter your age \n" ; cin >> a; if ( a <= 12 ) { cout << "Childe\n"; } else { cout << "Teeanager\n"; } if ( a >= 18 ) { cout << "Aldult\n"; } else { cout << "There is something wrong\n"; } return 0; } //when I enter a year older than 18, we write both teenager and child. And every time I start under the year it tells me that something is wrong..... And how can I make it wrong so that it only says when I type letters...

14th Aug 2022, 7:00 AM
Kmi
1 Answer
+ 1
Kmi Review lesson 13.1 of the C++ tutorial regarding nested else/if statements
14th Aug 2022, 7:06 AM
Rik Wittkopp
Rik Wittkopp - avatar