Computer Science, asked by QueenSaanvi, 1 month ago

Evaluate the following, where p, q are integers and r, f are floating point numbers.

The value of p=10, q=4 and r=2.5
(i)f=p* q + p/q
(ii)f=p+q-p%q*r

pls mod or star ans it ​

Answers

Answered by BrainlyProgrammer
5

Answer:

 \red{ \sf \: \bigstar given \: values \bigstar}  \begin{gathered} \begin{cases} p = 10 \\ q = 4 \\ r = 2.5\end{cases} \end{gathered}

  • f=p*q+p/q

Solution:-

 \sf \: f=p*q+p/q \\ : \implies \sf \: 10 \ast4 + 10/4 \\ : \implies40 + 2( \tt \: integer \: division) \\ : \implies  \underline{\green{ \boxed{42}}}

  • f=p+q-p%q*r

f=p+q-p \%q*r  \\ 10 + 4 - 10 \%4 \ast \: 2.5 \\ 10 + 4 - 2 \ast2.5 \\ 10 + 4 - 5.0 \\ 9.0

Similar questions