Hello again laserlight cheers for your help. I am doing Project Euler problems to learn c++ the current problem is:
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime...
Type: Posts; User: whiterebbit
Hello again laserlight cheers for your help. I am doing Project Euler problems to learn c++ the current problem is:
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime...
My code is written to find prime numbers from 2 to num. The code outputs every value of x, once if it is prime and more if it is not. I would like to know how to just output prime numbers. I am new...
cheers
Thank you very much that has solved it. Could you please explain the C++ code indenting rules so I can post it correctly in forums.
laserlight thanks for the response. Could you please explain what
[code]
int y = static_cast<int>(pow(x, 2) + 0.0001);
[/code ]
actually does, I think I understand it but it would help so I...
Have you run it on your computer it still gives 5^2=24 does it give the same answer on yours.
I'm a really newbie to programming so sorry if this is a silly question. But why does my code produce 1 less for 5^2 and for all multiples of 5 eg 5^2=24 and 10^2=99.
#include <iostream>...
Hey a friend introduced me to Project Euler and having fun solving there problems. I'm a really newbie and only been programming for 5 days now so please explain everything like you would to child....