I. Write java expression for the following: [5]
1. a2+ab - b2
2. (a+b)n
3. 2(lb+bh+lh)
4. √u2+2as
5. 5x3+2yx+y
Answers
Answered by
3
Solution :
- a² + ab - b²
Ans)) a*a + a*b - b*b;
- (a + b)n
Ans)) (a + b)*n;
- 2(lb+bh+lh)
Ans)) 2*(l*b+b*h+l*h);
- √(u² + 2as)
Ans)) Math.sqrt(Math.pow(u, 2) + 2*a*s);
- 5x³+2yx+y
Ans)) 5*Math.pow(x, 3) + 2*y*x + y;
Explore More :
- Some of the operators used in Java programming are different than the mathematical operators. Hence, Java expression will differ from mathematical expression.
- Java uses three types of operators. They are arithmetical, logical and relational operators.
- Arithmetical operator is divided into unary and binary operators.
- Logical operators is divided into AND, OR and NOT.
- Relational Operators are used to show the relation between two operands.
Similar questions