Computer Science, asked by aryan8410, 1 year ago

Question 2
Give the output of the following codes :
int totalcost-6;
int items - 12,
System.out.println("The cost per item is" + (totalcost/items)

Answers

Answered by cnprasad9
0

Answer:

-100

Explanation:

because -12(-12)

Answered by AskewTronics
0

The above code display a compile time errror.

Explanation:

  • The above code is written in the java language, in which the first and the second line display an error message.
  • It is because the first line and the second line have no assignment operator which is used to assign the value to the variable.
  • So when a user wants a right code then he needs to change the first and the second statement like-- "int totalcost=value;" and "int items=value;"

Learn More:

  • Java : https://brainly.in/question/13792074
Similar questions