Data type used for saving a single letter as a variable
Char (character)
Operator used for variable assignment
'='
Function for displaying output
printf
What's the output?
float x = 2;
printf("%.2f", x);
2.00
The function that we have already been using in our previous assingments
main
Data type for storing decimal values
Float
List the four basic mathematical operators
Addition, Subtraction, Multiplication, Divison
Function for taking input
scanf
What's the output?
float y = 4.53;
printf("%d", y);
Variables passed into functions
Parameters
The longest data type in the integer family tree
Long Long Int
What are the compound operators?
+=, -=, *=, /=, %=
Return type for <math.h> functions
double
What's the output?
float z = 4/3;
printf("%.2f", z);
1.00
Number of values that can be returned by a function
One
Float, Double, Long Double
Explain the modulus operator
Vote
floor
What's the output?
float z = 1.33;
printf("%f", z);
1.330000
Functions always return this, even if variables are not being passed
Control
The data type that we aren't allowed to use, as per course standards.
Boolean
Rank the precedence of the operators in this statement:
x *= 8 / 4 + (-- 2);
Parentheses, Prefix, Division, Addition, Assignment
Function libraries used in our previous assignments
<math.h> , <stdio.h>
What's the output?
float x = 10.5;
printf("%-5.2f", x);
Left Aligned, Five Reserved Spaces, 10.50
In the function definition:
void displayOutput (int)
Explain the significance of each word.
Void: Data/Return Type
Greeting: Function Name
Int: Parameter