0

Write a code that can print the prime numbers of a given value

Java and C++

4th Sep 2017, 10:55 AM
Uzondu Obillor
Uzondu Obillor - avatar
11 Respuestas
+ 8
A given value can be prime or not prime... but you cannot << print the prime numbers of a given value >>... this is rather called finding the prime factors... if this is what you're meaning ^^
4th Sep 2017, 11:01 AM
visph
visph - avatar
+ 6
part one: the prime function checker... https://code.sololearn.com/WteKxMC4vDvC/?ref=app part two: GCD function (using prime factorization): https://code.sololearn.com/WPXD8LSoeiIL/?ref=app
4th Sep 2017, 11:09 AM
visph
visph - avatar
+ 4
JS is enough near of both other syntax to be easily adapted/translated ^^
4th Sep 2017, 11:13 AM
visph
visph - avatar
+ 4
@Uzondu Obillor: there's a useful 'edit' option in top right three dots colon menu of each post ;)
4th Sep 2017, 4:45 PM
visph
visph - avatar
+ 2
This code finds primes up to the given number.If this is what you meant. https://code.sololearn.com/cwvereGBLoJS/?ref=app And this one finds the prime factors: https://code.sololearn.com/cnu88KWzGjlB/ref=app
4th Sep 2017, 1:51 PM
Haris
Haris - avatar
+ 1
thank u all.. I am grateful
4th Sep 2017, 4:41 PM
Uzondu Obillor
Uzondu Obillor - avatar
+ 1
grateful*
4th Sep 2017, 4:41 PM
Uzondu Obillor
Uzondu Obillor - avatar
+ 1
wow @visph tanx a lot.. I pay little attention, my bad
4th Sep 2017, 8:30 PM
Uzondu Obillor
Uzondu Obillor - avatar
0
the prime factors
4th Sep 2017, 11:04 AM
Uzondu Obillor
Uzondu Obillor - avatar
0
pls C++ or java
4th Sep 2017, 11:11 AM
Uzondu Obillor
Uzondu Obillor - avatar