Generation

generate functionSat, 12 Nov 2022

loop through the number 1-500 and return every number divisible by 13 as an array of doubles

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CSharp { class Program { static void Main(string[] args) { double[] result = new double[38]; int counter = 0; for (double i = 1; i <= 500; i++) { if (i % 13 == 0) { result[counter] = i; counter ++; } } } } }

Questions about programming?Chat with your personal AI assistant