Writing expression – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  

Login
[lwa]



Exam Questions-ICSE2016-03D #JAVA#4242    siteicon   siteicon  

Problem Statement - Writing expression

Write down java expression for :
T = square root (A2 + B2 + C2)

Solution

TC++ #4242

T = square root (A2 + B2 + C2)

double T = Math.sqrt(Math.pow(A,2)+Math.pow(B,2)+Math.pow(C,2));

Notes

  • It can also be written as
    double T = Math.sqrt(A*A+B*B+C*C);


Share

sunmitra| Created: 31-Mar-2018 | Updated: 16-Apr-2019|ICSE2016









Back