1/22
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
int main()
Marks the beginning of a function
Function
A group of more programming statements that collectively have a name
{
Left brace or opening brace
Beginning of a function
String Literal
Group of characters inside the quotation marks
;
Marks the end of a complete statement
}
Marks the end of a function
Newline Escape Sequence (\n)
Special command to advance the output cursor to the following line
Variable Definition
Tells the computer the variable’s name and the type of data that it will hold
Assignment
EX: number=5
Equal sign is an operator that copies the value on its right into the variable named on its left
Literals
piece of data written directly into a programs code
Identifier
Programmer-defined name that represents some element of a program
Integer Data Types
Can only hold whole number
char Data Type
Used to store individual character
Can only hold one character at a time
Character Literals
Are enclosed in single quotation marks
The string Class
Allows the programmer to create a string variable type
Using the string Class
Define a string type variable
Assign a string literal
Use out to display the value
Floating-Point Numbers
Data type that allows fractional values
float Data Type
Considered single precision
double Data Type
Twice as big as float
Considered double precision
bool Data Type
Expressions that have true or false values
Single-Line Comments
Use // on each line
Multi-Line Comments
Use /* to begin and */ to end
Named Constant
Like a variable but its content is read-only and cannot be changed while the program is running