To delete an element from the end in an array, we will just reduce the size of an array by one. After reducing the size we will print the array and will find that the last element is not printing. It means that the element is not in the array now.
C Program to delete element at end of Array
#include <stdio.h> void main() { int position, i, n, value,ch; printf("C Program to delete element at end of Array\n"); printf("First enter number of elements you want in Array\n"); scanf("%d", &n); int arr[n]; for(i = 0; i < n; i++) { printf("Please give value for index %d : ",i); scanf("%d",&arr[i]); } value=arr[n-1]; //assigning last value in value variable printf("Element %d is deleting at %d index \n",value,n-1); n=n-1;//here decreasing value to reduce size of array printf("New Array after deleting element at end \n "); for(i = 0; i < n; i++) { printf("%d \t",arr[i]); } }
Output

Also Prepare Below Important Question
- Python Program to add two number using Recursion
- Python Program to Find Highest Frequency Element in Array
- Python Program to Merge two Arrays
- Perform left rotation by two positions in Array Using Python
- Python Program to Delete Element at Given Index in Array
- Python Program to Delete element at End of Array
- Python Program to Copy one String to Another String
- Python Program to Remove Repeated Character from String
- Print highest frequency Character in String in Python
- Python Program to Convert lowercase vowel to uppercase
- Convert Celsius to Fahrenheit in Python
- Leap Year Program in Python
- Python Program to convert Decimal to Octal number
- Python Program to Convert Decimal Number into Binary
- Find all Pairs Whose Sum is Equal to Given number in Python
- Python Program to Replace First Vowel With ‘-‘ in String
- Python Program to find Prime factors of given integer
- Python Program to Print Prime Number in given range
- Java Program to Perform Left Rotation on Array Elements by Two
- Java Program to Perform Right Rotation on Array Elements by Two
Interview Questions Categories
C Programming Interview Preparation
Core Java Programming Interview Preparation
- Core Java Programming Coding Questions
- Core Java Pattern Programming Questions
- Core Java Programming Interview Questions