0
What is the error?
So, I can't find the error in this C++ code https://code.sololearn.com/c0q1R1TxuhI1/?ref=app
8 Réponses
+ 4
First off, as the compiler tells you, there is a closing curly missing for the if(age>=18) branch.
Then there may be some errors of a logical nature in the age limits. E.g. a newborn is 0 years of age, yet you disallow 0. A child of thirTEEN is a teenager, but your program requires an age of 15 to be accepted as teenager. But I cannot say there are errors since I do not know the original task. Perhaps these are the correct limits, I don't know.
+ 2
But it belongs in line 15 ½. The one in line 19 belongs to age>=13.
+ 2
Incidentally, when the compiler tells you there is a curly missing before the else in line 16, then it is usually a moot point trying to argue with the compiler ;) I am just a messenger passing on to you what the compiler says. But you can read it yourself after you hit "run"...
+ 1
It works now
+ 1
It's finished
+ 1
Awesome :D
0
There is no missing } because it's on line 19
0
Only one curly brace "}" of first nested "if" is missing
If(...){
If(....){
........
}<- this curly brace is missing in your code