Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ForEachLoop
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] todo = { "respond to email", "make wireframe", "program feature", "fix bugs" };
- foreach (string task in todo){ //for each element in the array
- CreateTodoItem(task); //invoke the method below to print each item in a list
- }
- }
- static void CreateTodoItem(string item)
- {
- Console.WriteLine($"[] {item}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement