Find the Missing Number in array

You are given a list of n-1 numbers and these numbers are in the range of 1 to n. There are no duplicates in list. One of the number is missing in the list. Write a program to find the missing number. Example:

Solution:

Output