title: Problem displaying fermat numbers greater than n = 5
body: <p>I am starting my work to finish my university degree and I encounter a problem in C++ to show fermat numbers greater than n = 5</p>
  
  <p>I don't understand why, for n = 5, the last number writes a 6 when it must be a 7.</p>
  
  <p>I pass you a very simple code since I first have to solve this problem before starting with the final program.</p>
  
  <pre><code>int n=0;
  long double resultado;
  
  
   printf ("\n\n MOSTRAR LOS DIEZ PRIMEROS NUMEROS DE FERMAT:\n");
   printf ( "-------------------------------------\n");
   printf(" Los numeros son los siguientes ");
  
  
  while(n&lt;10)
  {
  
          resultado= pow(2, pow(2, n)) + 1;
          n++;
          printf("%.Lf \n", resultado);
  
  
  }
  </code></pre>