+ 6

WAP in C++ to print n prime numbers using arrays

store the prime numbers in an array before displaying

6th Mar 2018, 1:26 PM
ADITYA HURIA
ADITYA HURIA - avatar
5 Answers
+ 15
@ Swapnil Srivastava, it seems to be a homework 👍😉
6th Mar 2018, 3:07 PM
tooselfish
tooselfish - avatar
+ 10
Homework ?
6th Mar 2018, 2:31 PM
Swapnil Srivastava
Swapnil Srivastava - avatar
29th Apr 2018, 6:46 AM
JULIUS FREDRICK
JULIUS FREDRICK - avatar
+ 6
Perhaps this will help: It's function check number and if it's prime return true bool simple(int n) { for (int i = 2; i <= n / 2; i++) if ((n%i) == 0) return false; return true; }
6th Mar 2018, 1:46 PM
Eugene Overchenko
Eugene Overchenko - avatar
+ 6
I edited my comments 😅 look again
6th Mar 2018, 1:52 PM
Eugene Overchenko
Eugene Overchenko - avatar