I've got the majority of this program finished. I need to out put the right sided traingle with a character to a file called ass2.run. It is creating a new file but their are no characters in the file that was created. Any help is appreciated.
#include<iostream>
#include<iomanip>
#include<fstream>
using namespace std;
void prompt();
main ()
{
int n;
char c;
prompt ();
cin>>n;
cout<< "Enter a character:"; // enters a character
cin>> c;
for (int i = 1; i <= n; i++) // for rows
{
for (int j = n - i;j > 0; j--) // for spaces
cout << " ";
for (int k = 1; k <= i; k++) // for characters
cout << c;
cout << endl;
}
ofstream fout("ass2.run");
return 0;
}
void prompt ()
{
cout<< "Enter a number:";
}[CODE]