C# code required
Write two code segments that print the integers 1 through 10. One segment should use a while loop and the other should use a for loop.
using System; class Program { static void Main() { for(int i = 1;i<=10;i++) Console.WriteLine(i); } }
///////////////////////////////////////////////////////////
using System; class Program { static void Main() { int i = 1; while(i<=10){ Console.WriteLine(i); i++; } } }
Get Answers For Free
Most questions answered within 1 hours.