Basic C++ Intro (Input, Placeholder, Operators & Logical Operators)
Request input from the user:
get_char();
get_double();
get_float();
get_int();
get_long();
get_string()
Placeholder output:
%c //character
%f //float
%i //integer
%li //long integer
%s //string
Operators:
= //assignment operator
+ //addition
- //substraction
* //multiplication
/ //division
% //modulus, gets the reminder of the division of two numbers
Logical operators:
&& //and operator
1 && 1 = 1 //true and true equals true
1 && 0 = 0 //true and false equals false
0 && 1 = 0 //false and true equals false
0 && 0 = 0 //false and false equals false
|| //or operator
1 || 1 = 1 //true or true equals true
1 || 0 = 1 //true or false equals true
0 || 1 = 1 //false or true equals true
0 || 0 = 0 //false or false equals false
! //not operator
1! //not true equals false
0! //not false equalas true
Increment or decrement:
int counter = 0;
//all of the examples adds 1 to the counter
counter = counter + 1;
counter += 1;
counter++;
//substract 1 to counter
counter = conter - 1;
conter -= 1;
counter--;
Last edit 12/19/2022