| | |
NEED help TO PUT THE FOLLOWING: IF((N == 2) && (T CAN'T BE DIVIDED BY 4))
![]() |
0
#2 Oct 16th, 2009
Most things can be divided. Do you mean is divided with no remainder?
The modulus operator is your friend here.
It returns 0 if no remainder would be returned on division.
The modulus operator is your friend here.
C Syntax (Toggle Plain Text)
for ( i=0; i<10; i++ ) { printf( "%d mod 4 = ", i, i%4 ); }
0
#3 Oct 16th, 2009
>how can I put: CAN'T BE DIVIDED BY 4?
C Syntax (Toggle Plain Text)
if( (N == 2) && (T % 4) ) { /* Your code here */ }
Last edited by tux4life; Oct 16th, 2009 at 4:20 pm.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
![]() |
Similar Threads
- filestream && multidimensional arrays (C++)
- Professional Shared & Reseller Web Hosting (Web Hosting Deals)
- do i need a sound card? (PCI and Add-In Cards)
- Windows installaton message "Setup didn't find any hard disk drives installed..." (Storage)
- Embedded Slide Show in Iframe (JavaScript / DHTML / AJAX)
- PHP parsing error, unexpected '<' (PHP)
- Drop Downlist Not Loading (VB.NET)
- XP & IE & foriegn language sites? (Windows NT / 2000 / XP)
Other Threads in the C Forum
- Previous Thread: removing white spaces
- Next Thread: Determine if a string is a directory name, file name or trash.
| Thread Tools | Search this Thread |
#include * ansi api array arrays asterisks binarysearch calculate centimeter changingto char character convert copyanyfile copyimagefile copypdffile creafecopyofanytypeoffileinc createcopyoffile createprocess() database dynamic execv fflush fgets file floatingpointvalidation fork forloop frequency function getlogicaldrivestrin givemetehcodez grade graphics gtkwinlinux histogram homework i/o inches include infiniteloop input interest intmain() iso keyboard km license linked linkedlist linux list looping loopinsideloop. lowest matrix microsoft mysql oddnumber open opendocumentformat openwebfoundation pdf pointer posix power program programming pyramidusingturboccodes radix read recursion recv recvblocked reversing scanf scheduling segmentationfault send sequential shape single socket socketprogramming stack standard strchr string suggestions test threads turboc unix urboc user variable whythiscodecausesegmentationfault win32api windowsapi






