Let me give you some of the details of what i am tring to do here.
I'm creating a mult. table. the program will prompt users to enter a table from 2 to 12, it will also ask if you want to run the program again. this is where I get lost. This is what I have so far.
# include <iostream>
# include <iomanip>
using namespace std;
int main ()
{
int table;
cout << "What size table would you like (2 to 12)? ";
cin >> table;
cout << " | ";
for (int a=0; a <=table; a++)
cout << setw (5) << a;
cout << endl;
cout << "------------------------------------------------------------------------------------------" << endl;
for (int across=0; across <=table; across++)
{
cout << setw (3) << across << setw (3) << " | " << ' ';
for (int down=0; down <=table; down++)
cout << setw (5) << down * across;
cout << endl;
}
return 0;
}
See where would I put the loop statement in and which one should I use?
I ran is so I know this part works.
Thank you all.




Reply With Quote