i++ i--

#include <iostream>

int main() {
    int i = 0;

    // Post-increment: i++ increments i after its current value is used
    std::cout << "Post-increment: i++" << std::endl;
    std::cout << "Initial value of i: " << i << std::endl;
    std::cout << "Value of i after post-increment: " << i++ << std::endl;
    std::cout << "Final value of i: " << i << std::endl << std::endl;

    i = 0;  // Reset i to 0

    // Pre-increment: ++i increments i before its current value is used
    std::cout << "Pre-increment: ++i" << std::endl;
    std::cout << "Initial value of i: " << i << std::endl;
    std::cout << "Value of i after pre-increment: " << ++i << std::endl;
    std::cout << "Final value of i: " << i << std::endl << std::endl;

    i = 0;  // Reset i to 0

    // Post-decrement: i-- decrements i after its current value is used
    std::cout << "Post-decrement: i--" << std::endl;
    std::cout << "Initial value of i: " << i << std::endl;
    std::cout << "Value of i after post-decrement: " << i-- << std::endl;
    std::cout << "Final value of i: " << i << std::endl << std::endl;

    i = 0;  // Reset i to 0

    // Pre-decrement: --i decrements i before its current value is used
    std::cout << "Pre-decrement: --i" << std::endl;
    std::cout << "Initial value of i: " << i << std::endl;
    std::cout << "Value of i after pre-decrement: " << --i << std::endl;
    std::cout << "Final value of i: " << i << std::endl;

    return 0;
}