I am having trouble with the following line of code:

```
double answer;
answer = num[count] / den[count]
cout << " Fraction" << count + 1 << " " << num[count] 
     << " / " << den[count] << " = " << answer << endl;

```

How come my rendition of answer is not working? Am I overlooking something? I am using arrays and am getting the data from a separate text file. When I use the code above I get the numbers that are to be divided correctly but the answer is incorrect. It comes out to be a random number usually 0 or 1. 

Here is my code:

```
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdlib>

using namespace std;
void read_data(int num[], int den[], int size);
void showValues(int num[],int den[], int size);

int main()
{
    const int size1 = 12;
    const int size2 = 12;
    ifstream dataIn;
    int num[12];
    int den[12];

    read_data(num,den,size1);
    cout << "Here are the fractions: " << endl;
    showValues(num,den,size1);

    system("PAUSE");
    return 0;
}

void read_data(int num[], int den[], int size)
{
    ifstream dataIn;
    dataIn.open("walrus.txt");

    if( dataIn.fail() )
         {
        cout << "File does not exist." << endl;
        exit(1);
         }

     int count;
     for ( count = 0; count < size; count++ )
     {
         dataIn >> num[count];
     }

     for (count = 0; count < size; count++)
     {
         dataIn >> den[count];
     }

     dataIn.close();
 }

void showValues(int num[],int den[], int size)
{
    int count;
        for (count = 0; count < size; count++)
        {
            if (den[count] == 0)
            {
                 cout << " Fraction" << count + 1 << " " 
                      << num[count] << " /" << den[count] 
                      << " Is invalid" << endl;
             }
            else
            {
                double answer;
                answer = num[count] / den[count];
             cout << " Fraction" << count + 1 << " " 
                  << num[count] << " / " << den[count] 
                  << " = " << answer << endl;
             }
        }
 }

```