antony romar
Major and importance difference between for and foreach loop ?
By antony romar in C# on Aug 07 2012
  • sandip punalkar
    Apr, 2013 22

    a for loop is a construct that says "perform this operation n. times".a foreach loop is a construct that says "perform this operation against each value/object in this IEnumerable"

    • 4
  • Venkatesh Kotte
    Mar, 2015 10

    yes

    • 0
  • Anurag Sarkar
    Apr, 2014 14

    For Loop static int Method1(int[] array) {int a = 0;for (int i = 0; i < array.Length; i++){a += array[i];}return a; }Foreach loop static int Method2(int[] array) {int a = 0;foreach (int value in array){a += value;}return a; }

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS