*I couldn't get the top row aligned right. The top row SHOULD be moved over to the right to line up with the columns.
I've got the correct output for columns 1, 2, 3, and 4 but I'm not sure how to get the correct output for columns 5 and 6.
Here is my code:
using namespace std;
for(int i = 1; i <11; i++)
a = i*10;
b = i-1;
c = i * i;
//d = Not Sure What to Do Here;
//e = Not Sure What to Do Here;
cout << left << setw (5) << i << left << setw (5) << a << left << setw (5) << b << left << setw (5) << c << left << setw (5) << d << left << setw (5) << e <<"\n";
If you run the code as-is, you'll get garbage from variables d and e because they haven't been initialized. So my question is what do I need to do to make variables d and e produce the correct numbers?
1 Year Ago
Related Article:C++ increment file
is a C++ discussion thread by Jbvo that has 8 replies, was last updated 2 years ago and has been tagged with the keywords: c++, file, increment.