format string cpp

#include <iostream>
#include <iomanip>
#include <string>

int main() {
    // Declare variables
    int intValue = 42;
    double doubleValue = 3.14159;
    std::string stringValue = "Hello, World!";

    // Display integer value with width of 10 characters, right-aligned
    std::cout << "Integer Value: " << std::setw(10) << std::right << intValue << std::endl;

    // Display double value with precision of 3 decimal places
    std::cout << "Double Value: " << std::fixed << std::setprecision(3) << doubleValue << std::endl;

    // Display string value with a minimum width of 20 characters, left-aligned
    std::cout << "String Value: " << std::setw(20) << std::left << stringValue << std::endl;

    return 0;
}