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;
          }

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