In this section, you will learn how to calculate sum of first and last element from the array of five numbers. You can see in the given example, we have allowed the user to enter five numbers of their choice. These numbers will get stored into the array as the user enters the number. Then using the index of the array, we have found first and the last number and determine their sum.
Here is the code:
|Enter five numbers:1
Sum of first and last number is: 6
Posted on: January 29, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles