I have wrtiting a c++ program below: #include <fstream.h> #include <iostream.h>
ID: 3616006 • Letter: I
Question
I have wrtiting a c++ program below:#include <fstream.h>
#include <iostream.h>
#include <stdio.h>
#include<conio.h>
//using namespace std;
int main()
{
char FirstName[30], LastName[30];
int Age;
char FileName[255];
char filename[30];
cout << " Enter the name of the fileyou want to create: ";
cin >> FileName;
int a=10,b=12,c=13;
sprintf(FileName, "%s,%i,%i,%i.txt", filename,a,b,c);
cout << "Enter First Name: ";
cin >> FirstName;
cout << "Enter Last Name: ";
cin >> LastName;
cout << "Enter Age: ";
cin >> Age;
ofstream Students(, ios::out);
Students << FirstName << " "<< LastName << " " << Age;
cout << " ";
return 0;
}
This program creates an output file with the name specified by theuser form prompt e.g. test.txt. I am trying to print the values ofvariables a,b,c as part of the file name e.g. test12.13.14.txt.