five

#include <iostream>

int main() {
    int num1 = 10;
    int num2 = 5;

    // Addition
    int sum = num1 + num2;
    std::cout << "Sum: " << sum << std::endl;

    // Subtraction
    int difference = num1 - num2;
    std::cout << "Difference: " << difference << std::endl;

    // Multiplication
    int product = num1 * num2;
    std::cout << "Product: " << product << std::endl;

    // Division
    int quotient = num1 / num2;
    std::cout << "Quotient: " << quotient << std::endl;

    // Modulus
    int remainder = num1 % num2;
    std::cout << "Remainder: " << remainder << std::endl;

    return 0;
}

Explanation:

  1. #include <iostream>: Includes the input-output stream library that provides functionality for input and output operations.

  2. int main() { }: Defines the main function where the execution of the program begins.

  3. int num1 = 10; and int num2 = 5;: Declares and initializes two integer variables num1 and num2 with values 10 and 5 respectively.

  4. int sum = num1 + num2;: Calculates the sum of num1 and num2 and stores it in the variable sum.

  5. std::cout << "Sum: " << sum << std::endl;: Prints the value of sum along with the text "Sum: " to the standard output (console).

  6. int difference = num1 - num2;: Calculates the difference between num1 and num2 and stores it in the variable difference.

  7. std::cout << "Difference: " << difference << std::endl;: Prints the value of difference along with the text "Difference: " to the standard output.

  8. int product = num1 * num2;: Calculates the product of num1 and num2 and stores it in the variable product.

  9. std::cout << "Product: " << product << std::endl;: Prints the value of product along with the text "Product: " to the standard output.

  10. int quotient = num1 / num2;: Calculates the quotient of dividing num1 by num2 and stores it in the variable quotient.

  11. std::cout << "Quotient: " << quotient << std::endl;: Prints the value of quotient along with the text "Quotient: " to the standard output.

  12. int remainder = num1 % num2;: Calculates the remainder of dividing num1 by num2 and stores it in the variable remainder.

  13. std::cout << "Remainder: " << remainder << std::endl;: Prints the value of remainder along with the text "Remainder: " to the standard output.

  14. return 0;: Indicates the successful termination of the main() function and the program with a return status of 0.