Most things can be divided. Do you mean is divided with no remainder?
The modulus operator is your friend here.
for ( i=0; i<10; i++ ) {
printf( "%d mod 4 = ", i, i%4 );
}
It returns 0 if no remainder would be returned on division.
twomers
Posting Virtuoso
1,877 posts since May 2007
Reputation Points: 453
Solved Threads: 57
>how can I put: CAN'T BE DIVIDED BY 4?
if( (N == 2) && (T % 4) )
{
/* Your code here */
}
tux4life
Nearly a Posting Maven
2,350 posts since Feb 2009
Reputation Points: 2,134
Solved Threads: 243
HEY I JUST NEED TO PUT THE FOLLOWING:
IF((N == 2) && (T CAN'T BE DIVIDED BY 4))
how can I put: CAN'T BE DIVIDED BY 4?
I know divided by 4 is : (t / 4).
but can not be divided by 4?
Use the modulus operator %
gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387