| | |
c++ code need answer
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
0
#3 Oct 22nd, 2009
Why don't you try searching the forums? The whole point of keeping the code in previous threads is so people will be able to learn from them in the future. I've seen this question asked many times in the past few weeks. Or you can actually try doing it yourself (that would be the prefered method)
Check out my new band URL on facebook. I'm the bass player. :) Become a fan and leave comments if you like.
URL on facebook!
URL on facebook!
-2
#4 Oct 22nd, 2009
Hi,
simple solution would be this boolean method...
returns true if it is prime, false otherwise...
ps...google
simple solution would be this boolean method...
returns true if it is prime, false otherwise...
C++ Syntax (Toggle Plain Text)
#include <cmath> bool IsPrime(int num) { if(num == 0) return true; num = abs(num); for(int i = 2; i <= sqrt(num); i++) if(num % i == 0) return false; return true; }
ps...google
![]() |
Similar Threads
- Get the coorect answer from each question (checkboxes) and compare (PHP)
- Dont understand the error in this code (C++)
- Series Help code Not working (C)
- Help could any one look to my code and answer my question? (C)
- java code help (Java)
- question&please answer (ASP.NET)
- Help with writing a bit of code (C)
Other Threads in the C++ Forum
- Previous Thread: binary tree insert
- Next Thread: number to word problem... help..!
Views: 202 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamiccharacterarray encryption error file format forms fstream function functions game givemetehcodez graph homeworkhelp iamthwee ifstream input int java lib lines list loop looping loops map math matrix memory newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search simple sort sorting spoonfeeding string strings struct temperature template templates text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






