turbot_yu
asked on
A simple IF expression
Hi,
I want to set a condition of
If temp_N mod 7 equals to 0 and (temp_N/7)>2,
I use the line below, but have error.
if((MOD(temp_N, 7)==0)&int((temp_N/7)>1))
Any suggestion?
Regards,
Turbot
I want to set a condition of
If temp_N mod 7 equals to 0 and (temp_N/7)>2,
I use the line below, but have error.
if((MOD(temp_N, 7)==0)&int((temp_N/7)>1))
Any suggestion?
Regards,
Turbot
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Steve,
When compile, still have error.
Does I need to add some .h file?
Thanks,
Turbot
When compile, still have error.
Does I need to add some .h file?
Thanks,
Turbot
ASKER
Error code:
D:\backup\desktop\power grid\pqhub\DTP\code\socket class by its\corrected\Deliver for Tan\Aug of eventDTP\eventDTP.cpp(2055 ) : error C2065: 'MOD' : undeclared identifier
Error executing cl.exe.
eventDTP.obj - 1 error(s), 1 warning(s)
D:\backup\desktop\power grid\pqhub\DTP\code\socket
Error executing cl.exe.
eventDTP.obj - 1 error(s), 1 warning(s)
I don't know of a MOD function in the standard library. That's why I used the modulus operator (%).
if ((temp_N % 7) == 0 && (temp_N / 7) > 1)