What's wrong? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What's wrong?

I'm trying to make a condition (with if and else if) and there is an error that says I can't use else if because I don't have if. Can someone explain me what's wrong?

10th Apr 2017, 9:02 PM
Γιάννης Δημητριάδης
Γιάννης Δημητριάδης - avatar
36 Answers
+ 5
men don't put ; after if condition and if else
10th Apr 2017, 9:12 PM
Kirito
Kirito - avatar
+ 9
Your welcome
10th Apr 2017, 9:16 PM
Manual
Manual - avatar
+ 8
Easy fix, delete the "elseif" and nest with another "if". this compiles. https://code.sololearn.com/cN5FwcNTg5OV/?ref=app
10th Apr 2017, 9:13 PM
Manual
Manual - avatar
+ 7
I recommend uploading you program, so someone can help you with it. When you make a comment tap insert and select the code you want.
10th Apr 2017, 9:05 PM
Manual
Manual - avatar
+ 3
no prob
10th Apr 2017, 9:15 PM
Kirito
Kirito - avatar
+ 3
im new too men, but hell yeah i love it...
10th Apr 2017, 9:17 PM
Kirito
Kirito - avatar
+ 2
give us the code
10th Apr 2017, 9:05 PM
Kirito
Kirito - avatar
+ 2
Thanks both of you.
10th Apr 2017, 9:14 PM
Γιάννης Δημητριάδης
Γιάννης Δημητριάδης - avatar
+ 2
I'm planning to study programming and I thought to start learn more about it before going to university. I'm new into that.
10th Apr 2017, 9:16 PM
Γιάννης Δημητριάδης
Γιάννης Δημητριάδης - avatar
+ 2
yeah but you are in a context of ages, normally it can't take negatives in real life...😂😉
10th Apr 2017, 9:48 PM
Kirito
Kirito - avatar
+ 2
yeaaah men, im really happy...😀😀😀😉
10th Apr 2017, 11:45 PM
Kirito
Kirito - avatar
+ 1
Can I ask something else?
10th Apr 2017, 9:29 PM
Γιάννης Δημητριάδης
Γιάννης Δημητριάδης - avatar
+ 1
sure?
10th Apr 2017, 9:32 PM
Kirito
Kirito - avatar
+ 1
ask...
10th Apr 2017, 9:32 PM
Kirito
Kirito - avatar
+ 1
what do you mean with satisfied?
10th Apr 2017, 9:35 PM
Kirito
Kirito - avatar
+ 1
if (x < 0) and x in this situation is -3
10th Apr 2017, 9:38 PM
Γιάννης Δημητριάδης
Γιάννης Δημητριάδης - avatar
+ 1
your x can't take a negative... but i don't think that i understood your question pretty good....😂😂
10th Apr 2017, 9:41 PM
Kirito
Kirito - avatar
+ 1
wait a little bit, im looking now, actually im a noob in C++ soo just a second...😉
10th Apr 2017, 9:49 PM
Kirito
Kirito - avatar
+ 1
it should be something like this... if(ya<0 || apa<0){ alert( you can't take a negative value)}; return 0; but i don't know how to write this in C++
10th Apr 2017, 9:54 PM
Kirito
Kirito - avatar