Ask Question
4 September, 00:54

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.

+4
Answers (1)
  1. 4 September, 03:05
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers