My thought process on my code

//include other code for you to use.
#include <iostream>

//The function where your program/compiler starts the runtime, you can pass a integer in main().
int main()
{
    //namespace "std" is include in iostream, "cout" is console, "<<" assinging into console.
    std::cout << "You are a secret agent breaking into a secure server room";
    std::cout << std::endl;
    std::cout << "You need to enter the correct codes to continue..." << std::endl;

    //Assigning variables into memory, const is like locking the variable.
    const int a = 4;
    const int b = 7;
    const int c = 12;

    //Adds "a", "b" and "c" integers and then assigns them into sum, thus into memory.
    const int sum = a + b + c;
    const int product = a * b * c;

    //Print to console sum.
    std::cout << std::endl;
    std::cout << sum << std::endl;
    std::cout << product << std::endl;

    //returns 0 to function main().
    return 0;
}

Privacy & Terms