C++ syntax

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/31

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:22 AM on 9/11/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

32 Terms

1
New cards

#include

are directives and interpreted by preprocessor before compiling

2
New cards

<iostream>

library that allwos standard I/O operations

3
New cards

using namespace std;

tells computer to use std namespace

4
New cards

//

indicates single line comment

5
New cards

int main() { }

special function called when program is run

6
New cards

cout «

character output device used to print values on console

7
New cards

return 0

returns integer to main

8
New cards

/* block comment */

multiple line comment

9
New cards

type VariableName

used to declare variables

10
New cards

bool

boolean

11
New cards

int

integer

12
New cards

char

character

13
New cards

float

floating point number

14
New cards

double

double precision floating point number

15
New cards

string

group of characters

16
New cards

const

used to not override existing variable values

17
New cards

&&

logical operator: and

18
New cards

||

logical operator: or

19
New cards

!

logical operator: not

20
New cards

++

arithmetic operator: increment adding one

21
New cards

arithmetic operator: increment subtracting one

22
New cards

cin »

used to get user input

23
New cards

getline(cin, myString)

used to include spaces in inputs

24
New cards

cin.sync()

used along with getline

25
New cards

if (condition) {

statements

}

used to specify code to be executed if condition is true

26
New cards

else {

statements

}

used to specify a code to be executed to be executed if condition is false

27
New cards

else if (condition) {

statement

}

used to specify new condition to test if first condition is false

28
New cards

switch (variable) {

case 1:

case 2:

case 3:

default

}

used to specify many alternative blocks of code only limited to one variable

29
New cards

while (condition)

{

(statements)

}

loop that tests condition and repeats statements while condition is true

30
New cards

do

{

(statements)

} while (condition)

loop that executes statements then evaluates condition

31
New cards

for (initialization; condition; increase)

{

(statements)

}

loop designed to iterate a specific number of times

32
New cards

x[max values] = {value 1, value 2, value 3}

used to store multiple values in a single variable