From 1fd504e2eb500c6553cab552046d2a644c45340a Mon Sep 17 00:00:00 2001 From: Arbaaz Shaikh Date: Sun, 29 Oct 2023 23:16:47 +0530 Subject: [PATCH] Create insertionanddeletion.c This is the code for insertion and deletion in Singly Linkedlist in C. --- insertionanddeletion.c | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 insertionanddeletion.c diff --git a/insertionanddeletion.c b/insertionanddeletion.c new file mode 100644 index 0000000..e6f07ac --- /dev/null +++ b/insertionanddeletion.c @@ -0,0 +1,61 @@ +#include +#include +void main() +{ +int c=-1,a[1000],n=0; +clrscr(); +while(c!=5) +{ +printf("*menu**1.add\n2.remove\n3.modify\n4.print\n5.exit\n enter the number"); +scanf("%d",&c); +switch(c){ +case 1: +if(n<100){ +printf("enter the value to be added"); +scanf("%d",&a[n]); +n++; + + +} +else{ +printf("array is full !\n"); + +} +break; +case2 : +if(n>0){ +printf("element has to be remover d"); +scanf("%d",&q); +q--; +if(q<0|| q>n-1) +{ +printf("invalid input\n"); +} +else{ +for(i =q;i