A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

Write a Java program to print the result of the following operations
Q:

Write a Java program to print the result of the following operations

0

Write a Java program to print the result of the following operations
Test Data:
a. -5 + 8 * 6
b. (55+9) % 9
c. 20 + -3*5 / 8
d. 5 + 15 / 3 * 2 - 8 % 3

Expected Output :
43
1
19
13

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

public class Exercise4 {
 
 public static void main(String[] args) {
  System.out.println(-5 + 8 * 6);
  System.out.println((55+9) % 9);
  System.out.println(20 + -3*5 / 8);
  System.out.println(5 + 15 / 3 * 2 - 8 % 3);
 }
 
}

Sample Output:

43                                                                                                      
1                                                                                                      
19                                                                                                      
13

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now