Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- /*
- ====================
- VARIABLES
- ====================
- int a; // Declare variable
- a = 5; // Assignment
- --------------------
- Types: int, float, bool, char, double
- Shorthands:
- int a = 5; // Same as int a; a = 5;
- a += 5; // Same as a = a + 5;
- a++; // Same as a = a + 1;
- ====================
- EXPRESSIONS
- ====================
- bool var = (a > b); // Evaluates and sets as TRUE or FALSE
- --------------------
- Conditional Operators: >, <, >=, <=, ==, !=, !
- Combine conditions: &&, ||
- ====================
- FLOW OF CONTROL
- ====================
- A:
- GOTO A; // Will start executing from A
- // ^ Example of infinite loop.
- if( condition )
- statement; // Only executed if condition == true
- --------------------
- while( condition )
- statement;
- // Is the same as
- B:
- if( !condition )
- GOTO A;
- statement;
- GOTO B;
- A:
- ====================
- INPUT/OUTPUT
- ====================
- printf( "FORMAT", arg1, arg2, ... );
- scanf( "FORMAT", arg1, arg2, ... );
- */
- int main()
- {
- // BEGIN CODE HERE
- // END CODE HERE
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement