Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (maram):

write a program that asks a user to enter an integer, then print out a list of all the factors of such number, which means a list of all the number that can evenly divide into such number. for Example, if user enter 9, then your program should print out a list of fallowing numbers: 1,-1, 3, -3, 9, -9.

OpenStudy (farmdawgnation):

Hi maram, welcome to OpenStudy. So, first I do find it somewhat peculiar that you're required to list negative factors as well, but leave it to teachers to cook something like that up. It looks like you're off to a good start. Here are some of the problems I see: * You're using capital letters for things like "Cout", "Cin", and "Return". These should all be lowercased. * Your loop clause is spelled incorrectly. You spelled it "Wile" and it should be "while" * The program, as you have it written won't output the negatives. But that should be really simple to fix.

OpenStudy (rsmith6559):

Cin>>inputs; inputs (plural) isn't declared. Wile((input%i>0)&&(i<=input)){ Why is the while loop conditional on whether the modulus is non-zero? I++; I (capital) isn't declared.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!