
- COMMENTS
// Word or words
...
/*
Word or words
*/
...
...
...
- BASIC LIBRARIES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
...
...
...
- STRUCTS
struct StructureName-I
{
VARIABLETYPE VARIABLE-I;
VARIABLETYPE VARIABLE-II;
VARIABLETYPE VARIABLE-N;
};
...
struct StructureName-II
{
VARIABLETYPE VARIABLE-I;
VARIABLETYPE VARIABLE-II;
VARIABLETYPE VARIABLE-N;
};
...
struct StructureName-N
{
VARIABLETYPE VARIABLE-I;
VARIABLETYPE VARIABLE-II;
VARIABLETYPE VARIABLE-N;
};
...
...
...
- INPUT AND OUTPUT
...
- NEW LINE
\n
...
I - STRING INPUT
char VARIABLE[];
or
char VARIABLE[DESIRED_SIZE];
cin >> VARIABLE;
...
II - TEXT INPUT
const int TEXT_SIZE = 1000;
char TEXT[TEXT_SIZE];
cin.getline(TEXT, TEXT_SIZE);
...
III - STRING OR TEXT OUTPUT
cout << "WORD or TEXT\n";
...
IV - VARIABLE OUTPUT
cout << VARIABLE;
...
V - WORD OR TEXT OUTPUT WITH VARIABLES
cout << "WORD or TEXT " << VARIABLE << " WORD or TEXT " << VARIABLE << "\n\n";
...
...
...
- CONTROL STRUCTURES
break; STOP HERE
continue; GO TO THE NEXT OPTION
...
I - GOTO STATEMENT - JUMPS
... The goto statement works within the same function and within the same method. Therefore, jumping between functions, methods, and classes using goto is impossible. The goto statement can jump to a previous point in the code or to a later point in the code.
goto CHOSEN_LABEL;
STRUCTURES
CHOSEN_LABEL:
or
CHOSEN_LABEL:
STRUCTURES
goto CHOSEN_LABEL;
...
I - IF AND IF/ELSE SELECTIONS
if (IF THIS IS TRUE, THEN DO THE FOLLOWING)
SINGLE-LINE STATEMENT;
{
MULTI-LINE STATEMENTS;
}
else
SINGLE-LINE STATEMENT;
{
MULTI-LINE STATEMENTS;
}
...
II - SWITCH SELECTION
switch (SELECT THE CASE EQUAL TO THIS VARIABLE)
{
case '1':
ACTION;
break;
case '2':
ACTION;
break;
case 'N':
ACTION;
break;
}
...
...
...
- REPETITION STRUCTURES - LOOPS
...
I - DO/WHILE LOOP
do
SINGLE-LINE STATEMENT;
{
MULTI-LINE STATEMENTS;
}
while (WHILE THIS IS TRUE);
...
II - WHILE LOOP
while (DO THE FOLLOWING WHILE THIS IS TRUE)
SINGLE-LINE STATEMENT;
{
MULTI-LINE STATEMENTS;
}
...
III - FOR LOOP
for (FROM_THIS; TO_THIS; DECREMENT or INCREMENT)
SINGLE-LINE STATEMENT;
{
MULTI-LINE STATEMENTS;
}
...
...
...
- ARRAYS
I - ONE-DIMENSIONAL ARRAY
int VARIABLE;
...
II - TWO-DIMENSIONAL ARRAY
int VARIABLE[DESIRED_SIZE][DESIRED_SIZE];
...
III - THREE-DIMENSIONAL ARRAY
int VARIABLE[DESIRED_SIZE][DESIRED_SIZE][DESIRED_SIZE];
...
...
...
- FUNCTION PROTOTYPES
void functionName-I(PARAMETER-I, PARAMETER-II, PARAMETER-N);
void functionName-II(PARAMETER-I, PARAMETER-II, PARAMETER-N);
void functionName-N(PARAMETER-I, PARAMETER-II, PARAMETER-N);
...
...
...
- MAIN FUNCTION
int main(void)
{
VARIABLES;
struct VARIABLES;
- INPUT AND OUTPUT
- CONTROL STRUCTURES
- REPETITION STRUCTURES - LOOPS
Function-I;
Function-II;
Function-N;
}
...
...
...
- FUNCTIONS
void functionName-I()
{
VARIABLES;
struct VARIABLES;
- INPUT AND OUTPUT
- CONTROL STRUCTURES
- REPETITION STRUCTURES - LOOPS
}
...
void functionName-II()
{
VARIABLES;
struct VARIABLES;
- INPUT AND OUTPUT
- CONTROL STRUCTURES
- REPETITION STRUCTURES - LOOPS
}
...
void functionName-N()
{
VARIABLES;
struct VARIABLES;
- INPUT AND OUTPUT
- CONTROL STRUCTURES
- REPETITION STRUCTURES - LOOPS
}
...
...
...
- EXAMPLE SOFTWARE
The order of the structures matters... Everything that will be used later must be declared beforehand.
...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
struct StructureName-I
{
VARIABLETYPE VARIABLE-I;
VARIABLETYPE VARIABLE-II;
VARIABLETYPE VARIABLE-N;
};
...
struct StructureName-II
{
VARIABLETYPE VARIABLE-I;
VARIABLETYPE VARIABLE-II;
VARIABLETYPE VARIABLE-N;
};
...
struct StructureName-N
{
VARIABLETYPE VARIABLE-I;
VARIABLETYPE VARIABLE-II;
VARIABLETYPE VARIABLE-N;
};
- FUNCTION PROTOTYPES
void functionName-I(PARAMETER-I, PARAMETER-II, PARAMETER-N);
void functionName-II(PARAMETER-I, PARAMETER-II, PARAMETER-N);
void functionName-N(PARAMETER-I, PARAMETER-II, PARAMETER-N);
int main(void)
{
VARIABLES;
struct VARIABLES;
- INPUT AND OUTPUT
- CONTROL STRUCTURES
- REPETITION STRUCTURES - LOOPS
functionName-I(PARAMETER-I, PARAMETER-II, PARAMETER-N);
functionName-II(PARAMETER-I, PARAMETER-II, PARAMETER-N);
functionName-N(PARAMETER-I, PARAMETER-II, PARAMETER-N);
}
int functionName-I(PARAMETER-I, PARAMETER-II, PARAMETER-N)
{
VARIABLES;
struct VARIABLES;
- INPUT AND OUTPUT
- CONTROL STRUCTURES
- REPETITION STRUCTURES - LOOPS
functionName-I(PARAMETER-I, PARAMETER-II, PARAMETER-N);
functionName-II(PARAMETER-I, PARAMETER-II, PARAMETER-N);
functionName-N(PARAMETER-I, PARAMETER-II, PARAMETER-N);
}
int functionName-II(PARAMETER-I, PARAMETER-II, PARAMETER-N)
{
VARIABLES;
struct VARIABLES;
- INPUT AND OUTPUT
- CONTROL STRUCTURES
- REPETITION STRUCTURES - LOOPS
functionName-I(PARAMETER-I, PARAMETER-II, PARAMETER-N);
functionName-II(PARAMETER-I, PARAMETER-II, PARAMETER-N);
functionName-N(PARAMETER-I, PARAMETER-II, PARAMETER-N);
}
int functionName-N(PARAMETER-I, PARAMETER-II, PARAMETER-N)
{
VARIABLES;
struct VARIABLES;
- INPUT AND OUTPUT
- CONTROL STRUCTURES
- REPETITION STRUCTURES - LOOPS
functionName-I(PARAMETER-I, PARAMETER-II, PARAMETER-N);
functionName-II(PARAMETER-I, PARAMETER-II, PARAMETER-N);
functionName-N(PARAMETER-I, PARAMETER-II, PARAMETER-N);
}