Aug 2, 2024
#include <iostream>
(for input/output operations)int main()
functionreturn 0;
to end the program.std::cout
to print output.
std::cout << "Hello, World!";
std::endl
or
to move to a new line.std::cin
to take user input.
std::cin >> x;
std::cin >> x >> y;
int
, long
, long long
, float
, double
for numbers.char
for single characters.std::string
for strings.int
for numbers within certain ranges; switch to long
or long long
for larger numbers.// comment
/* comment */
if (condition) { // code } else { // code }
switch(variable) { case value: // code; break; default: // code; }
int arr[5];
arr[0], arr[1]...
int arr[rows][columns];
.size()
or .length()
.for (initialization; condition; increment) { // code }
while (condition) { // code }
do { // code } while (condition);