Q: How to use flex bison to make them understand various rules and act according to them? This is the .l file
 %{
   #include <stdlib.h>
   #include "y.tab.h"
 %}

 %% 
 "true"              {yylval=1;  return BOOLEAN;}
 "false"             {yylval=0;  return BOOLEAN;}
 "nor"               {return NOR;}
 " "                 { }
 .                   {return yytext[0];}

 %%

 int main(void)
 {
   yyparse();
   return 0;
 }

 int yywrap(void)
 {
  return 0;
 }
 int yyerror(void)
 {
 printf("Error\n");
 }

 **This is the .y file**

/* Bison declarations.  */
 %token BOOLEAN
 %token NOR
 %left NOR
 %% /* The grammar follows.  */

 input:
  /* empty */
  | input line
    ;

  line:
   '\n'
   | exp '\n' {printf ("%s",$1); }
   ;

  exp:
   BOOLEAN     { $$ = $1;}
   | exp NOR exp   { $$ = !($1 || $3); }
   | '(' exp ')'  { $$ = $2;}
   ;
   %%

While I execute them in visual studio using the console application, a command window appears saying "press any key to continue" and after pressing any key it disappear.
This code is not working properly.  What needs to be done to integrate this functionality with already existing code?

A: 
I don't know if it's still relevant to answer, but here are my thoughts.
You have several problem here.
1. . in flex, doesn't include \n.
2. You are asking way too much to these tools.
As for the first point, it's rather easy to fix. Just add a rule to match \n in flex.  
For the second point, how bison and flex should know that parsing the word true mean setting their internal value to a boolean value meaning true ?
Here are the changes you should make:
/* Flex. */
/* ... */
true { yylval = 1; return BOOLEAN; }
false { yylval = 0; return BOOLEAN; }
/* ... */

/* Bison. */
/* ... */
| exp '\n' { printf($1 ? "true\n" : "false\n"); }
/* ... */

