Matrix Output in Console

Hey, I am struggling with the output of a "matrix". Well it is not a matrix, but it has to look like one.

I don't know where to put the endl;

The integer numbers have to be in front of the doubles in each row.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  for(anzahl; anzahl<=250000; anzahl=anzahl+10000)
        {
            gesamt_rohstoff = anzahl * gesamtpreis1;
            cout << anzahl << "\t";

            for(prozent; prozent<=0.1; prozent=prozent+0.01)
            {
                hkosten = gkosten + gesamt_rohstoff;
                gewinn = (prozent * hkosten);
                summe = gewinn + hkosten;

                cout << summe/anzahl << "\t";

            }
            prozent=0.01;
            cout << endl;
        }


output looks like this: https://i.gyazo.com/108c16d3247898183fa8daf9f0c4406f.png
Last edited on
I don't know where to put the endl;

It seems to be in the right place.

output looks like this:

In that .png image, the output is overflowing onto the next line because the column width of the console window is too small. You may be able to alter the size of the console window to get it to display properly.
Hmm, i got the console on full screen but it does not use the whole space.
Ahh you were right. I altered the space of the console and it worked! :) Thx!
Topic archived. No new replies allowed.