Computer Applications
A girl wanted to calculate the sum of two numbers stored as a and b multiplied by 7. Select the appropriate Java expression.
- a + b*7
- 7*a + b
- (a + b)*7
- a + 7*b
Java Operators
1 Like
Answer
(a + b)*7
Reason — To calculate the sum of two numbers stored as a and b multiplied by 7, we use parentheses to add a and b first, then multiply the result by 7. The correct expression is (a + b)*7.
Answered By
2 Likes
Related Questions
Name the data types in order from top, given in the above picture.

- int, char, double, String
- String, int, char, double
- char, double, int, String
- int, double, char, String
How many bytes are occupied by the below two-dimensional array?
156 20 154 20 130 20 130 20 162 17.67 161 20 158 17.5 154 20 - 96 bytes
- 128 bytes
- 12 bytes
- 24 bytes
The sum of
a[1]anda[3]in the arrayint a[] = {20, 40, 60, 80, 100}is:- 80
- 100
- 120
- 60
State which access specifier is less restrictive.

- private
- protected
- default
- public