I'm trying to make a program that outputs a parabola. The user inputs the variables, and it's supposed to output blank spaces for where the points are, and sharp signs for points not on the graph and it's supposed to skip lines after 20 characters are put in. However, it only outputs the sharp signs and it does not skip lines. Here's the code for outputting the graph:
int placement()
{
//loops until all rows are filled
for (parse = 0; parse < 400; parse++)
{
int j = 0;
int k = 0;
if (j < 19)
{
if (output[j][k] == ' ')
{
cout<<output[j][k];
j += 1;
}
else
{
//doesn't matter if it is a space or a sharp sign
cout<<output[j][k];
j += 1;
}
}
elseif (j == 19)
{
j = 0;
cout<<string(1, '\n');
k += 1;
}
}
}
Your if-else on lines 10-20 is a bit unnecessary because both the if part and the else part do the exact same thing, but that shouldn't be a problem though.
do you have any additional code?
because output and parse are not defined here.
also you function is supposed to return int but it doesn't return anything.