How do I print the last element of an array in c?

If you want to print the last element of an array in C. This program is simple in 3 to 4 steps.

Let’s see an example: 


  1. In this program firstly take the array variable.
  2. The second step is to calculate the size of the array using sizeof the operator. size = sizeof(arr)/sizeof(int);
  3. Then, the last step to print the arr [size - 1].

Comments

Popular posts from this blog

proassignment help backlink data index 41

Programming shark backlink data index 67

programming shark backink data index 31