Language: C

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

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

 Nodepointer *nil;

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

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

 void printlist(){
          Nodepointer *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){
          Nodepointer *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){
          Nodepointer *ser=nil->next;
          while(ser != nil && ser->key != key){
                       ser=ser->next;
                       }
          return ser;
          }
          

 void delete(Nodepointer *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:11:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Nodepointer'
   11 |  Nodepointer *nil;
      |  ^~~~~~~~~~~
main.c:11:2: error: unknown type name 'Nodepointer'
main.c: In function 'init':
main.c:14:11: error: 'nil' undeclared (first use in this function)
   14 |           nil=malloc(sizeof(struct Node));
      |           ^~~
main.c:14:11: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'printlist':
main.c:21:11: error: unknown type name 'Nodepointer'
   21 |           Nodepointer *ser=nil->next;
      |           ^~~~~~~~~~~
main.c:21:28: error: 'nil' undeclared (first use in this function)
   21 |           Nodepointer *ser=nil->next;
      |                            ^~~
main.c:27:33: error: request for member 'key' in something not a structure or union
   27 |                  printf("%d",ser->key);
      |                                 ^~
main.c:28:25: error: request for member 'next' in something not a structure or union
   28 |                  ser=ser->next;
      |                         ^~
main.c:30:11: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   30 |           pritf("\n");
      |           ^~~~~
      |           printf
main.c: In function 'insert':
main.c:35:11: error: unknown type name 'Nodepointer'
   35 |           Nodepointer *x=malloc(sizeof(Node));
      |           ^~~~~~~~~~~
main.c:35:40: error: 'Node' undeclared (first use in this function)
   35 |           Nodepointer *x=malloc(sizeof(Node));
      |                                        ^~~~
main.c:36:12: error: request for member 'key' in something not a structure or union
   36 |           x->key=key;
      |            ^~
main.c:38:11: error: 'nil' undeclared (first use in this function)
   38 |           nil->next->prev=x;
      |           ^~~
main.c:39:12: error: request for member 'next' in something not a structure or union
   39 |           x->next=nil->next;
      |            ^~
main.c:41:12: error: request for member 'prev' in something not a structure or union
   41 |           x->prev=nil;
      |            ^~
main.c: In function 'serch':
main.c:45:11: error: unknown type name 'Nodepointer'
   45 |           Nodepointer *ser=nil->next;
      |           ^~~~~~~~~~~
main.c:45:28: error: 'nil' undeclared (first use in this function)
   45 |           Nodepointer *ser=nil->next;
      |                            ^~~
main.c:46:34: error: request for member 'key' in something not a structure or union
   46 |           while(ser != nil && ser->key != key){
      |                                  ^~
main.c:47:31: error: request for member 'next' in something not a structure or union
   47 |                        ser=ser->next;
      |                               ^~
main.c:49:18: error: returning 'int *' from a function with incompatible return type 'struct Node *' [-Wincompatible-pointer-types]
   49 |           return ser;
      |                  ^~~
main.c: At top level:
main.c:53:14: error: unknown type name 'Nodepointer'
   53 |  void delete(Nodepointer *x){
      |              ^~~~~~~~~~~
main.c: In function 'deletefirst':
main.c:61:11: error: implicit declaration of function 'delete' [-Wimplicit-function-declaration]
   61 |           delete(nil->next);
      |           ^~~~~~
main.c:61:18: error: 'nil' undeclared (first use in this function)
   61 |           delete(nil->next);
      |                  ^~~
main.c: In function 'deletelast':
main.c:65:18: error: 'nil' undeclared (first use in this function)
   65 |           delete(nil->prev);
      |                  ^~~
main.c: In function 'main':
main.c:79:21: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   79 |                  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:79:21: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   79 |                  if(strlen(com)<=6){
      |                     ^~~~~~
main.c:79:21: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:86:16: error: expected ';' before ':' token
   86 |        return 0:
      |                ^
      |                ;
main.c:87:8: error: expected declaration or statement at end of input
   87 |        }
      |        ^