Can someone tell me why this code doesn't work?? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

Can someone tell me why this code doesn't work??

22nd Jun 2020, 4:49 AM
Laiz N
Laiz N - avatar
6 Antworten
+ 5
For the sake of compatibility, prefer `&&` operator over the alias 'and'. Most C++ coders write boolean expressions using `&&` operator, while 'and' is an occasionally option.
22nd Jun 2020, 6:02 AM
+ 4
The "if" statement are comparing two senteces. ( compare1 ) "and" ( compare2 ) = boole result. //true or false you wrote : "else if ( a >= 400 and <= 699){ " observe the second compare sentence. it`s something missing. "699 <= ?(missing thing)" ex.: if ( a >= 400 and a <= 699) I hope it helps. Have a nice coding.
22nd Jun 2020, 5:07 AM
Bruno Franco
Bruno Franco - avatar
22nd Jun 2020, 5:17 AM
Ptar* - avatar
+ 3
your first if and last else if !!!!!!!! check those conditions here they are overlapping at a = 1000 so if a= 1000 then it will the first result and then exit!!!!!
22nd Jun 2020, 5:07 PM
Abhishek Dimri
Abhishek Dimri - avatar
+ 2
Bruno Franco Explained Right Laiz N Because YouÔÇÖre Using and keyword so both of the conditions seems to be true but in right side expression you wonÔÇÖt compared your variable ÔÇśaÔÇÖ which arised error in your code. Here I Made Corrections In Your Code ­čśŐ
22nd Jun 2020, 5:13 AM
Rahul Saxena
Rahul Saxena - avatar
+ 2
Ah ha..thanks so much guys, that totally cleared things up for me..
22nd Jun 2020, 6:15 AM
Laiz N
Laiz N - avatar