write the output of the following program snippet
1. int a=5 ,int b= 4
find
int c = b % a
int c= a + b* a
Answers
Answered by
0
Answer:
(1) c = 4
(2) c = 25
Explanation:
(1) c = b % a = 4 % 5 (i.e. remainder of the division that will be 4 because 5 cannot divide 4)
(2) c = a + b*a = 5 + 5*4 (Java follows BEDMAS so firstly it will multiply and the equation will become 5 + 20 and the answer will be 25)
.
.
.
.
HOPE THIS HELPS YOU
.
.
.
.
PLEASE MARK AS BRAINLIEST AND FOLLOW ME TOO
Answered by
3
Question:-
Write the output of the following code snippet.
Answer:-
Given,
int a=5,b=4;
Now,
c=b%a
Or,
c=1(5 divided by 4 gives remainder 1)
Again,
c=a+b*a
Or,
c=5+20
Or,
c=25
Similar questions