| | |
c++ code need answer
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
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: 201 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll dynamic encryption error file forms fstream function functions game getline givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linker linux loop looping loops map math matrix memory microsoft newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






