I need help Fixing this I traced through the code, and it compiles not error but when I run the program its just goes crazy I need help finding a the soultion to this problem please
Thank you very much
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
int even(int sumE, int num, int temp);
int main ()
{
int num, sumE=0, temp=0;
ifstream inData;
inData.open("f:/p4.txt");
inData >> num;
while (!inData.eof() )
{
cout << num << " " << endl;
//inData >> num;
//even(sumE, num, temp);
}
cout << "The sum of the even numbers is: " << sumE;
inData.close();
system("pause");
return 0;
}
int even(int sumE, int num, int temp)
{
if (num%2==0)
sumE= temp +num;
}