| | |
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 |
adobe api array arrays binarysearch calculate char cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators intmain() iso kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix microsoft motherboard mqqueue mysql oddnumber odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer posix power probleminc program programming pyramidusingturboccodes read recursion recv recvblocked repetition research scanf scheduling segmentationfault send shape socketprograming socketprogramming stack standard strchr string suggestions systemcall test unix urboc user variable voidmain() wab win32api windows.h






