Language: C

#include<stdio.h>
#include<stdlib.h>

 struct Node{
           Node *prev;
           Node *next;
           int key;
           };

 Node *nil;

 void init(){
          nil=malloc(sizeof(Node));

          nil->prev=nil;
          nil->next=nil;
          }

 void printlist(){
          struct Node *ser=nil->next;
          int isf=0;

          while(1){
                 if(ser==nil)break;
                 if(isf++>0)printf(" ");
                 printf("%d",ser->key);
                 ser=ser->next;
                 }
          pritf("\n");
          }


 int insert(int key){
          struct Node *x=malloc(sizeof(Node));
          x->key=key;

          nil->next->prev=x;
          x->next=nil->next;
          nil->next=x;
          x->prev=nil;
          }

 struct Node *serch(int key){
          struct Node *ser=nil->next;
          while(ser != nil && ser->key != key){
                       ser=ser->next;
                       }
          return ser;
          }
          

 void delete(struct Node *x){
          if(x==nil)return;
          x->prev->next=x->next;
          x->next->prev=x->prev;
          free(x);
          }

 void deletefirst(){
          delete(nil->next);
          }

 int deletelast(){
          delete(nil->prev);
          }

 int deletekey(int key){
          delete(serch(key));
          }

 int main(){
       int i,n,k;
       char com[20];
       init();
       scanf("%d",&n);
       for(i=0;i<n;i++){
                 scanf("%s %d",&com,&k);
                 if(strlen(com)<=6){
                                 if(com[6]=='t'){insert(k);}
                                 else if(com[6]=='e'){deletekey(k);}
                 else if(com[7]=='F'){deletefirst();}
                 else if(com[7]=='L'){deletelast();}
                 }
       printlist();
       return 0:
       }







Compiler output:
main.c:5:12: error: unknown type name 'Node'
    5 |            Node *prev;
      |            ^~~~
main.c:6:12: error: unknown type name 'Node'
    6 |            Node *next;
      |            ^~~~
main.c:10:2: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   10 |  Node *nil;
      |  ^~~~
      |  struct 
main.c: In function 'init':
main.c:13:29: error: 'Node' undeclared (first use in this function)
   13 |           nil=malloc(sizeof(Node));
      |                             ^~~~
main.c:13:29: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:14: error: request for member 'prev' in something not a structure or union
   15 |           nil->prev=nil;
      |              ^~
main.c:16:14: error: request for member 'next' in something not a structure or union
   16 |           nil->next=nil;
      |              ^~
main.c: In function 'printlist':
main.c:20:31: error: request for member 'next' in something not a structure or union
   20 |           struct Node *ser=nil->next;
      |                               ^~
main.c:24:24: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
   24 |                  if(ser==nil)break;
      |                        ^~
main.c:27:21: error: assignment to 'struct Node *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   27 |                  ser=ser->next;
      |                     ^
main.c:29:11: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   29 |           pritf("\n");
      |           ^~~~~
      |           printf
main.c: In function 'insert':
main.c:34:40: error: 'Node' undeclared (first use in this function)
   34 |           struct Node *x=malloc(sizeof(Node));
      |                                        ^~~~
main.c:37:14: error: request for member 'next' in something not a structure or union
   37 |           nil->next->prev=x;
      |              ^~
main.c:38:22: error: request for member 'next' in something not a structure or union
   38 |           x->next=nil->next;
      |                      ^~
main.c:39:14: error: request for member 'next' in something not a structure or union
   39 |           nil->next=x;
      |              ^~
main.c: In function 'serch':
main.c:44:31: error: request for member 'next' in something not a structure or union
   44 |           struct Node *ser=nil->next;
      |                               ^~
main.c:45:21: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
   45 |           while(ser != nil && ser->key != key){
      |                     ^~
main.c:46:27: error: assignment to 'struct Node *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   46 |                        ser=ser->next;
      |                           ^
main.c: In function 'delete':
main.c:53:15: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
   53 |           if(x==nil)return;
      |               ^~
main.c:54:18: error: request for member 'next' in something not a structure or union
   54 |           x->prev->next=x->next;
      |                  ^~
main.c:55:18: error: request for member 'prev' in something not a structure or union
   55 |           x->next->prev=x->prev;
      |                  ^~
main.c: In function 'deletefirst':
main.c:60:21: error: request for member 'next' in something not a structure or union
   60 |           delete(nil->next);
      |                     ^~
main.c: In function 'deletelast':
main.c:64:21: error: request for member 'prev' in something not a structure or union
   64 |           delete(nil->prev);
      |                     ^~
main.c: In function 'main':
main.c:78:21: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   78 |                  if(strlen(com)<=6){
      |                     ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strlen'
    2 | #include<stdlib.h>
  +++ |+#include <string.h>
    3 | 
main.c:78:21: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   78 |                  if(strlen(com)<=6){
      |                     ^~~~~~
main.c:78:21: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:85:16: error: expected ';' before ':' token
   85 |        return 0:
      |                ^
      |                ;
main.c:86:8: error: expected declaration or statement at end of input
   86 |        }
      |        ^