Explaining the sections of code in TripleX

  1. Preprocessor Directive - is just grabbing someone else’s code and putting it in this project so we can use it. In this case it allows us to print things.
  2. Main Function - is where all of the code goes. It is simply defining what code is going to be executed.
  3. Expression Statements 1 - is printing each line at a time, whether it is a string, int, or line break.
  4. Declaration Statements - is defining all of the integers. In this case all of them are constant. There are some that assign numbers (int a = 1 int b = 2), and some that assign equations (int sum = a + b).
  5. Expression Statements 2 - is printing things after the variables have been defined.
  6. Return Statement - by having “int” main(), you are saying that it needs to “return” as an integer. We put 0 after return because it is saying that the program was successful.
1 Like

Privacy & Terms