C# Multiplication table

10x10 multiplication table using C#

Page 1 of 1

1 Replies - 6484 Views - Last Post: 20 October 2009 - 06:03 PM Rate Topic: -----

#1 lzoulek  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 15
  • Joined: 19-October 08

C# Multiplication table

Post icon  Posted 20 October 2009 - 05:55 PM

Okay, you guys have helped me with one of the problems i was having creating another program. Now I am trying to create a 10x10 multiplication table using C#. I have the code done and when i execute it comes up briefly and then disappears. Normally I add Console.ReadLine() to the end and that solves the problem, but with this code when i add ReadLine to the code it just comes up with an empty window. Can anyone tell me why it wont accept the command?


using System;
public class MultiplicationTable
{
	public static void Main()
	{
		int i = 1;
		while (i <= 10)
		{
			int j = 1;
			string line = "";
			while (j <= 10)
			{
				line += (i * j).ToString() + " ";
				j++;
			}
			Console.WriteLine(line);
			i++;
			
		}
	}
}



Is This A Good Question/Topic? 0
  • +

Replies To: C# Multiplication table

#2 bodom658  Icon User is offline

  • Villiage Idiom
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,123
  • Joined: 22-February 08

Re: C# Multiplication table

Posted 20 October 2009 - 06:03 PM

try using Console.Read() as opposed to ReadLine()... I can't think of anything that would cause it to do that.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1