title: c language : read file content as numbers and add them together
body: <p>I have the following in a text file called: values.txt</p>
  
  <pre><code>1 4 
  2.5 3.76
  122 10
  277.543 
  165.4432
  </code></pre>
  
  <p>I am trying to read the content of this text file, and add each two pairs together and output the result ...
  the output would be something like this :</p>
  
  <pre><code>1 Pair:(1, 4) = 5
  
  2 Pair:(2.5, 3.76)= 6.26
  </code></pre>
  
  <p>and so on ..</p>
  
  <p>I am opening the file like this </p>
  
  <pre><code>int c;
  FILE myfile; 
  
  myfile= fopen("values.txt", "r"); 
  if ( myfile == NULL ) { 
    printf("Cannot open TEXT file\n");
    return 1; 
  }
  
  double aa,bb;
  while ( (c = getc(myfile) ) != EOF ) { 
      // HERE SHOULD I DO THE OUTPUT BUT HOW?
  }
  </code></pre>
  
  <p>Any help is really appreciated ..</p>
  
  <p>Language = C</p>