Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace harel
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. Console.Write("Please write a number between 1 - 10: ");
  15. int number = int.Parse(Console.ReadLine());
  16. int column = 1;
  17. // first row
  18. Console.Write("x");
  19. for (int i = 1; i <= number; i++)
  20. {
  21. Console.Write("{0,5}", i);
  22. }
  23.  
  24. Console.WriteLine("");
  25. Console.WriteLine("");
  26.  
  27. for (int row = 1; row <= number; row++)
  28. {
  29. column = 1;
  30. Console.Write("{0}", row);
  31.  
  32.  
  33.  
  34. for (column = 1; column <= number; column++)
  35. {
  36. Console.Write("{0,5}", row * column);
  37. }
  38.  
  39. Console.WriteLine("");
  40. Console.WriteLine("");
  41.  
  42. }
  43.  
  44.  
  45. Console.ReadKey();
  46.  
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement