How to write a program of prime number's series from 1-100 in C++
first of all you need a for loop from 2 to 100 , and a function called prime (int x) (for example) that determines weather the number x is prime or not , for (int x=2; x<=100;x++) if (prime (x)==true) cout << x; this is just a hint , if u need anything else we'r here to help
prime number detection, either with citation or(in pseudocode): for i=2 -> sqrt(x) i++ if(x mod i == 0) x->prime -> quit end loop x->not prime
He is not going to learn anything if you just give him the answer...
He is going to learn a lot if he studies the algorithm i gave him...
and besides that i just gave him a pseudocode, he wants a c++ program..
I understand what you gave him, but he needs to ask for questions, not answers. Pseudocode is the answer minus proper syntax.
Join our real-time social learning platform and learn together with your friends!