public static void Main()
int[] nums = new int[] {20, -2, 6, 2, 1, 3};
if(Above(nums, num) != -1)
Console.WriteLine("The index of the number that the total of the numbers behind him is bigger that {0} is the {1}.", num, Above(nums, num));
Console.WriteLine("There was no total number bigger than {0}.", num);
public static int Above(int[] arr, int n)
int sum = arr[0], index = 0;
for(int i = 1; i < arr.Length; i++)