Help with multiplication table loop program
prompt: need the user to input 1st and last values for the table. DIsplay in a column in the table starting with 1st base value that was inputted. Last column has to the ending base value that was entered. I need to make 15 rows of computations. First row should be for 1 times the beginning base , 1 times the (begiing base value +1), through 1 times the ending base value. he last row should be for 15 times the beginning base, 15 times the (beginning base value +1) , through 15 times the ending base value. Base values can range from 2 through 8. Display an aethetically formatted multiplication table
here is what I have so far:
using System;
class Program
{
static void Main()
{
string inValue;
int baseFirst,
baseLast;
for (int a = 1; a < 10; a++)
{
for (int b = 1; b < 10; b++)
{
Console.Write((a * b).ToString("1"));
}
DisplayResults();
Console.WriteLine();
}
}
}
what should I do from here?!
Thanks
techlawsam
Junior Poster in Training
56 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
Well, try to change your for loops to this:
for (int a = 1; a <= 10; a++)
{
for (int b = 1; b <= 10; b++)
{
Console.Write("{0}\t",(a * b).ToString());
}
//DisplayResults(); display is already done by Write and WriteLine
Console.WriteLine();
}
If there are things you don't understand, please ask. :)
ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661