Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(){
- int a[100],n,loc,element,i;
- printf("Enter the number of ELement: ");
- scanf("%d",&n);
- printf("Enter the ELements of Array: ");
- for(i=0;i<n;i++){
- scanf("%d",&a[i]);
- }
- printf("a[%d]: ",n);
- for(i=0;i<n;i++){
- printf("%d ",a[i]);
- }
- printf("\nEnter the location you want to delete: ");
- scanf("%d", &loc);
- for(i=loc;i<n;i++){
- a[i]=a[i+1];
- }
- n=n-1;
- printf("New array, a[%d]: ",n);
- for(i=0;i<n;i++){
- printf("%d ",a[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement