I need to know how can I print in C# (and Visual Studio) numbers from 0 to 9? tahnks
Try with while loop:
using System; class PrintNumbers { static void Main() { int i = 0; while (i < 10) { Console.WriteLine(i); i++; } } }
Or with for loops:
using System; class PrintNumbers { static void Main() { for (int i = 0; i < 10; i++) //initialization, test, update { Console.WriteLine(i); } } }
622 questions
979 answers
129 comments
53 users