New course! Every coder should learn Generative AI!
Try a free lesson+ 2
Ok, I don't know how I didn't get that before but you can't use the "," sign to separate the number you might wanna either delete it or use the "_" sign instead
+ 1
You are very welcome
+ 1
Doug Schmitz
In my opinion your code is just a bit longer.
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {Scanner a=new
Scanner(System.in);
int b=a.nextInt();
if (b>7){System.out.println("Profit");}
else if (b<7){System.out.println("Loss");}
else{System.out.println("Broke Even");}
}
}
0
What do you mean by not working?
Can you send this as a code so we can run it and see the output?
0
Make a new code in code playground and paste it there then save it and send it here