Ask Question
9 November, 13:57

Write a program that will accept input of two positive decimal integer values and output the prime factorizations of the input values. A sample run is below. User input is in boldface.

+1
Answers (1)
  1. 9 November, 14:29
    0
    C code given below

    Explanation:

    #include

    void factorize (int num) {

    int i = 2;

    printf ("The prime factorization of %d is ", num);

    while (num! = 0) {

    if (num % i = = 0) {

    printf ("%d", i);

    num / = i;

    if (num! = 1) {

    printf ("*");

    }

    else{

    printf ("./n");

    break;

    }

    }

    else{

    ++i;

    }

    }

    }

    int main () {

    int num;

    printf ("Give them to me one by one and I will do the factoring. / n");

    printf ("Number? ");

    scanf ("%d", &num);

    factorize (num);

    printf ("Number? ");

    scanf ("%d", &num);

    factorize (num);

    return 0;

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a program that will accept input of two positive decimal integer values and output the prime factorizations of the input values. A ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers