In the following test case program I'M trying to figure out how I can use the remainder of divison to make a decision but I can not seem to get this test case to respond in the way that I think and want it to respond based upon the remainder of dividing two command line arguments (linux). It never out puts either one of my cout statements even when I'M feeding it 3 & 7 or 3 & 8.
Here's the program:
#include <iostream>
#include <stdlib.h>
int main( int argc, char* argv[] )
{
//number1 = atoi(argv[1]);
//number2 = atoi(argv[2]);
if ( atoi( argv[1] ) % atoi( argv[2] ) == .33333 )
{
std::cout << "33333" << std::endl;
}
else if ( atoi( argv[1] ) % atoi( argv[2] ) == .66667 )
{
std::cout << "66667" << std::endl;
}
return 0;
}