Answer:
The above program is not correct, the correct program in c++ langauge is as follows:
#include <iostream>//header file.
using namespace std; //package name.
int main() //main function.
{
char char_input;//variable to take charater.
int size,i,j;//variable to take size.
cout<<"Enter the size and charter to print the traingle: ";//user message.
cin>>size>>char_input; //take input from the user.
for(i=0;i<size;i++)//first for loop.
{
for(j=0;j<=i;j++)//second for loop to print the series.
cout<<char_input<<" ";//print the charater.
cout<<"\n";//change the line.
}
return 0; //returned statement.
}
Output:
Explanation: