auto in cpp

#include <iostream>

int main() {
    // Step 1: Declare a variable and initialize it with an integer value.
    auto number = 42;

    // Step 2: Declare a variable and initialize it with a double-precision floating-point value.
    auto pi = 3.14;

    // Step 3: Declare a variable and initialize it with a character.
    auto letter = 'A';

    // Step 4: Declare a variable and initialize it with a string.
    auto greeting = "Hello, World!";

    // Step 5: Declare a variable and initialize it with the result of an expression.
    auto sum = number + pi;

    // Step 6: Display the values of the variables.
    std::cout << "Number: " << number << std::endl;
    std::cout << "Pi: " << pi << std::endl;
    std::cout << "Letter: " << letter << std::endl;
    std::cout << "Greeting: " << greeting << std::endl;
    std::cout << "Sum: " << sum << std::endl;

    return 0;
}