+ 2
int x = 10 if (x > -1); if (x != 0); if (x > 0); System.out.println (“x is a positive number having value “ + x);
It produce error output😢... Sorryyy I'm a beginner and I wanted to learn coding but sad to say that was so hard for me😣
2 Antworten
0
Error because if statement is a code block but you are putting semicolon after it. Try putting curly braces after your if statements {} but leave the semicolon after "int x = 10" hope this helps.
+ 1
Please don't write your code in the title, if your code is short you can paste in Description, if it is big code, then save and share its link by following the below guide
https://www.sololearn.com/post/75089/?ref=app