Module: Arithmetic expressions


Problem

2 /7


Arithmetic expressions

Theory Click to read/hide

The expression on the right side of the assignment operator allows you to calculate values ​​using various formulas.

What an expression can contain
x integers and real numbers (in real numbers, the integer and fractional parts are separated by a dot, not a comma, as is customary in mathematics)
• arithmetic signs:  
+ addition,
- subtraction,
* multiplication,
div integer division,
mod remainder of division

x calls to standard functions (for some of them, you need to include the math library - for this, at the very beginning of the program, before declaring variables, you need to add the line "uses math;")
 abs(i) integer modulus i  
 sqrt(x) the square root of the real number x
 power(x,y) calculates x to the power of y

x parentheses to change the order of actions

Problem

Write a program that calculates the value of the variable y using the formula:
y=(1-x2+2.5x3+x4)2

The value of the variable x is set from the keyboard. Determine the types of variables x and y yourself.
Display the value of the y variable on the screen