Code:Im given two arrays int [] scores1 = {2,5,8,10} int [] score2 = {5,6,8,12} and asked to multiply 1st element of scores 1 by last element of scores2.. would i use a for statement for this?? like: for (int i = 0
Code:Im given two arrays int [] scores1 = {2,5,8,10} int [] score2 = {5,6,8,12} and asked to multiply 1st element of scores 1 by last element of scores2.. would i use a for statement for this?? like: for (int i = 0
Since you know the array lengths in advance:
Otherwise:Code:int result = score1[0] * score2[3];
Have a read of this Arrays Tutorial (C#) to better understand what arrays are and how the work.Code:int result = score1[0] * score2[score2.Length - 1];
cheers..