I'm having a lot of troubles trying to read the input data into the program. I'm a beginner of C++ and this is my first time to learn to use functions. I wrote out the code but I only got zero. Can someone please help me out?
I have use the following input data:
to determine the integers if they are:
1)a multiple of 7, 11 or 13
2)sum of the digits odd or even
3)the square root value(if positive)
4)is it a prime number
and here is my code:
using namespace std;
#define in_file "data.txt"
#define out_file "result.txt"
if (num%7==0 || num%11==0 || num%13==0)
cout<<num<<" is a multiple of 7, 11 or 13."<<endl;
cout<<num<<" is a even number."<<endl;
cout<<num<<" is a odd number."<<endl;
double square(double value)
cout<<"The square root value is: "<<value<<endl;
for (int i=2; i<=num; i++)
for (int j=2; j<i; j++)
cout<<num<<" is a prime number."<<endl;
cout<<num<<" is not a prime number."<<endl;