Question: Using Javascript Accept any number in text box. Display its prime factors? 

Answer: var intValue = 57;\n\n   while( intValue > 1) {\n      for( var intNumber = 2; intNumber <= intValue; intNumber++) {\n         if( intValue % intNumber == 0) {\n            returnValue += intNumber + " ";\n            intValue /= intNumber;\n            break;\n         }\n      }\n   }
This question from the Yahoo Q&A forum is categorized in the topic: Education & Reference