Advertisement
A4L

Chapter - 15 - Methods (1)

A4L
Dec 7th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 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 Chapter___15___Methods
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             CountToTen();
  14.             Console.ReadKey();
  15.         }
  16.  
  17.         static void CountToTen()
  18.         {
  19.             Console.Write("\n1");
  20.             for (int i=2; i<=10; i++)
  21.             {
  22.                 Console.Write($", {i}");
  23.             }
  24.             Console.Write("\n");
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement