At least show me the logic on how to solve the math problem parts. I will put it into program if you just explain to me how to get the factors, tell the computer how many factors, find the sum and print it to screen, and find the product and print it to screen. Then i will put it all together.
Hi, im kinda new to using loops in my programming. I'm still a little rusty. could someone hep me out a little on this problem?
I sure could use some quick help from you guys. You've always been there in the past. Thanks so much.
I need a program that will prompt the user for a single positive integer greater than 1. If the user does not enter a valid integer, then the program should continue to reprompt the user for a value until a valid integer is entered. Once the integer is read in, the program will print out the following information about the integer:
- A list of each of the positive factors of the given integer.
- The number of factors the given integer has.
- The sum of the factors of the integer.
- The product of the factors of the integer.
An example output would be :
Enter a positive integer greater than one.
12
Here is a list of the positive factors of 12:
1 2 3 4 6 12
The number of positive factors of 12 is 6.
The sum of the positive factors of 12 is 28.
The product of the positive factors of 12 is 1728.
thanks so much guys.
Heres what i got so far :
int main()
{
int LoopCount = 0;
int integer;
printf("Enter a positive integer greater than one.\n";
scanf("%d", integer);
for (int j=1; j <= LoopCount; j++){
for (int integer=1; integer <=LoopCount; integer++){