Computer Science, asked by vanshi2757, 1 year ago

Find the output:a=10;b=20....C=b%a+5 according to computer

Answers

Answered by Anonymous
3

a = 10 ;

b = 20 ;

c = b%a + 5 ;

c = 20 % 10 + 5

⇒ c = 0 + 5

⇒ c = 5

OUTPUT : 5

Explanation :

According to the precedence of operators first we should apply modulus which is denoted by (%) .

That operator is used for getting the remainder of a particular division .

For example : 5 % 3 will leave us remainder 2 .

For example : 60 % 7 will leave the remainder 4 .

After that we can perform the addition .

We know that 20%10 = 0 and hence b%a will be 0 .

b%a + 5 = 0 + 5 and hence the output will be 5 .

The semi colon sign (;) shows the end or termination of a statement .

Similar questions