What is the error in this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the error in this code?

I want to create a java program that calculates whether a number is a lab number or not. A lab number is a number whose prime factor's square is also a factor of that number. Please help😖😖

14th Nov 2019, 1:47 AM
︻╦╤─♦งēຖ໐๓♠彡
︻╦╤─♦งēຖ໐๓♠彡 - avatar
4 Answers
0
Post your code. So we can tell what is less in your code. Logic how you can start doing this problem. 1. Take number from user and get prime factors, store factors in array. 2. Then you get factors in array then square each element of your array. 3. Now compare user number to each element in array. 4. If you found number print lab number , if don't found then not.
14th Nov 2019, 2:17 AM
Chirag Kumar
Chirag Kumar - avatar
14th Nov 2019, 2:17 AM
︻╦╤─♦งēຖ໐๓♠彡
︻╦╤─♦งēຖ໐๓♠彡 - avatar
0
Any number which is lab number ? Means example
14th Nov 2019, 2:18 AM
Chirag Kumar
Chirag Kumar - avatar
0
A lab number is a number whose prime factor's square is also a factor of a number Eg: 8,50
14th Nov 2019, 2:20 AM
︻╦╤─♦งēຖ໐๓♠彡
︻╦╤─♦งēຖ໐๓♠彡 - avatar