Math Flashcards
abs
returns absolute value
random
return’s random value
squrt
returns square root of positive number
round
round real number to nearest integrar
int abs(int num)
returns the absolute value.
double pow(double num, double power)
returns number to the power.
double sqrt(double num)
returns square root of positive number
What are three things for defining a variable?
- Type
- Variable name
- Value
PEMDAS
Parenthesis, Exponents, Multiplication, Division, Addition and Subtraction.
+
Addition
Subtraction
-
*
Multiplication
÷
Division
%
Modulus(to get the remainder.)
1 + 2 × 3 + 7 x 2 % 5
11
What is casting?
Casting is converting one date type to another.
Which of the following choices is the correct syntax for declaring a real number variable?
a. int grade : 4.0;
b. 4.0 = grade;
c. double grade = 4.0;
d. grade = 4;