#Same program as ma homie Crypto G
1 messages · Page 1 of 1 (latest)
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
u didn't ask any question yet
and ur title will ensure that nobody wants to click on ur post lol
Have to find # with biggest amount of factors from 1-1000
So far I'm looping thru 1 and 1000, and nesting anothe for loop in it so it looks from 1 to the number that X currently is in the main for loop
Then I have an if statement, correct me if I have any errors (please),
if(x % y == 0){
factorCount = factorCount + 1;
}
and I think it gets the total amount of factors for the X value
And then I have another if statement in the same nested for loop (let me know if I'm doing anythng wrong here)
which basically sets the X number as the biggest factor if it is the biggest factor
I said the initial variable's value as 1 (I don't think it matters if it's 0 or 1)
so basically everytime it loops that's how I'm getting the number wiht the greatest amount of factors, idk if I'm doing something wrong in the print or in general my code is incorrect
I think my print line is supposed to be outside to loop (other wise it goes on infinitely), but I get variable is not initialized (I try to print X)
so I'm not really sure what's wrong with my code, can I please get some help?
i think you have it a bit backwards
you don't want to set x to greatedFactor
you want to set biggestFactor to x
or err.
there is more to fix
just keep following the other thread
alr