Tag: C#

30 Days of Code – Day 21: Generics

30 Days of Code – Day 21: Generics

Task: Utilize “generics” by creating a function, PrintArray, which takes an array of generic elements as a parameter. Then the function should print each element of its generic array parameter on a new line.

Continue reading “30 Days of Code – Day 21: Generics”

Advertisements
30 Days of Code – Day 5: Loops

30 Days of Code – Day 5: Loops

Task: Using a loop, print out multiplication tables from 1 to 10 based on a given integer, n. Print out the multiplication table in 10 lines, one line per multiplication equation.

Process: Use a loop which has an integer i value used to count from 1 to 10 for iteration through loop, and as this is occurs, also use that integer as the number we’re multiplying n by for the multiplication table. To print out the results, basically create a string that is “{n} x {i} = {n * i}.”

Continue reading “30 Days of Code – Day 5: Loops”