Advertisement
Nickpips

Untitled

Oct 11th, 2015 (edited)
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. /*
  4. ====================
  5. VARIABLES
  6. ====================
  7.  
  8. int a; // Declare variable
  9. a = 5; // Assignment
  10.  
  11. --------------------
  12.  
  13. Types: int, float, bool, char, double
  14.  
  15. Shorthands:
  16. int a = 5; // Same as int a; a = 5;
  17. a += 5; // Same as a = a + 5;
  18. a++; // Same as a = a + 1;
  19.  
  20. ====================
  21. EXPRESSIONS
  22. ====================
  23.  
  24. bool var = (a > b); // Evaluates and sets as TRUE or FALSE
  25.  
  26. --------------------
  27.  
  28. Conditional Operators: >, <, >=, <=, ==, !=, !
  29. Combine conditions: &&, ||
  30.  
  31. ====================
  32. FLOW OF CONTROL
  33. ====================
  34.  
  35. A:
  36. GOTO A; // Will start executing from A
  37. // ^ Example of infinite loop.
  38.  
  39.  
  40. if( condition )
  41. statement; // Only executed if condition == true
  42.  
  43. --------------------
  44. while( condition )
  45. statement;
  46. // Is the same as
  47. B:
  48. if( !condition )
  49. GOTO A;
  50. statement;
  51. GOTO B;
  52. A:
  53.  
  54. ====================
  55. INPUT/OUTPUT
  56. ====================
  57.  
  58. printf( "FORMAT", arg1, arg2, ... );
  59. scanf( "FORMAT", arg1, arg2, ... );
  60.  
  61. */
  62.  
  63. int main()
  64. {
  65. // BEGIN CODE HERE
  66.  
  67.  
  68.  
  69. // END CODE HERE
  70. return 0;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement