Well the beauty of HTML is that it's standard text, which means you can create and open them with ofstream. If you know file I/O, then this should be no problem, otherwise I could post an example.
Simply make a string, input whatever you want into it in the program, concatenate .html onto the end of the string the open the string. You've now created an HTML file which you can output code into.
Here is some example code:
Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
ofstream makeHTML;
string pageName;
cout << "Enter the name you want for the webpage: ";
cin >> pageName; // I use cin rather than getline because you don't
// want spaces here.
pageName += ".html"; // Add .html to the end. You may want to do a check
// to see if the user already put it in.
makeHTML.open(pageName.c_str());
makeHTML << "<html> \n" << endl;
makeHTML << "<head> \n <title>HTML in C++ is easy!</title> \n </head> \n" << endl;
makeHTML << "<body> \n \n <p align=\"center\"><b><font size=\"5\">CONGRATULATIONS! ";
makeHTML << "YOU JUST MADE AN HTML PAGE IN C++!</font></b></p> \n" << endl;
makeHTML << "</body> \n </html>";
return 0;
}