Hi,
I have always programed in Turbo C 3.0 and little exp. with 4.5 but recently I installed Borland C++ Builder 6 and the environment is completely diifferent..
I was just testing some codes to get used to this new environment..
But this code below is giving an error i've never experienced before..
can any one pls help..
thnx in Advance..
/*EvaluatePrimeNo.cpp */
#include<iostream>
#include "EvaluatePrimeNo.h"
using namespace std;
bool EvaluatePrimeNo::isPrime(int a)
{
int flag=0;
for(int i=2;i<=a-1;i++)
{
if(a%i==0)
{
flag=0;
break;
}
else
{
flag=1;
}
}
if(flag==0)
return 0;
else if(flag==1)
return 1;
}
int main()
{
EvaluatePrimeNo n;
int num=94;
cout<<n.isPrime(num);
}
/*EvaluatePrimeNo.h*/
class EvaluatePrimeNo {
public:
bool isPrime(int a);
};
and this is the error I'm getting..
[C++ Warning] EvaluatePrimeNo.cpp(24): W8070 Function should return a value
[Linker Fatal Error] Fatal: Could not open C:\Program Files\Borland\CBuilder6\Projects\Project1.exe (error code 5)