0% found this document useful (0 votes)
15 views1 page

Practical No 04

The document presents a C program aimed at performing a deletion operation in an array. It initializes an array with five elements, removes the element at index 3, and then displays the modified array. There are some syntax errors in the code that need to be corrected for proper execution.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views1 page

Practical No 04

The document presents a C program aimed at performing a deletion operation in an array. It initializes an array with five elements, removes the element at index 3, and then displays the modified array. There are some syntax errors in the code that need to be corrected for proper execution.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Practical No:04

AIM: write a program for deletion operation in an array.


Name: Shreyash P. Bayskar
Class: B.C.A 1st
Code:
#include <stdio.h>
void main() {
int LA[]= {1, 3, 5, 7, 8} ; int k = 3, n = 5; int i, j;
printf("The original array elements are :\n");
for(i =0; i < n ;i++) {
printf("LA[%d] = %d \n", i, LA[i]); }
j = k;
while(j<n){
LA[j - 1] = LA[j];
j-j+1;}
n=n-1
printf("The array elements after deletion:\n");
for( i = 0; i < n ;i++)}
printf("LA[%d] = %d \n", i, LA[i]);
}}
Output:
LA[5] = 8
The original array elements areArray element after deletion
LA[0] = 1LA[0] = 1
LA[1] = 3LA[1] = 3
LA[2] = 5 LA[2] = 7
LA[3] = 7 LA[3] = 8

You might also like