#include <stdio.h>
#include <stdlib.h>

int main()

{
 char title [20], bgColor [20], fontFace [15], fontSize [5],
bodyText [40];
 char fName [20] = {0};
 FILE *outfile;
 char html [6] = ".html";

     printf("\n		QuestionHTML version 1.0 by Psonetwo		\n");
printf("		////////////////////////////////////	");
     printf("\n\nEnter the file name of your page: ");
     if(fgets(fName, sizeof fName, stdin) == fName){
	fName[strlen(fName) - 1] = 0; }
     strcat (fName, html);

     printf("\nEnter the title of your page: ");
     fgets(title, sizeof title, stdin);

     printf("\nEnter the background colour: ");
     fgets(bgColor, sizeof bgColor, stdin);

     printf("\nChoose a font for your page: ");
     fgets(fontFace, sizeof fontFace, stdin);

     printf("\nWhat size font would you like to use: ");
     fgets(fontSize, sizeof fontSize, stdin);

     printf("\nWhat text would you like to appear: ");
     fgets(bodyText, sizeof bodyText, stdin);

   outfile = fopen (fName, "w");

   fprintf(outfile, "<html>\n<head><title>%s</title></head>\n\n<body bgcolor = %s>\n<font face = %s size = %s>%s</body><a href=http://www.geocities.com/psonetwo><font color=black size=8 face=Comic Sans MS>Generated by QuestionHTML version 1.0: Program made by Psonetwo</a>\n<a href=mailto:psonetwo@NOSPAMyahoo.com><font color=black size=8 face=Comic Sans MS>Email for feedback</a></html>", title, bgColor, fontFace, fontSize, bodyText);
   fclose (outfile);

   printf("\nYour page %s has been created.\n\n", fName);

   return 0;
}
