1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kirza4 [7]
4 years ago
6

Write a program that will accept input of two positive decimal integer values and output the prime factorizations of the input v

alues. A sample run is below. User input is in boldface. So you want two numbers factored. Give them to me one by one and I will do the factoring.
A. The prime factorization of 12 is:________.
B. The prime factorization of 1050 is:________.
Computers and Technology
1 answer:
Sidana [21]4 years ago
3 0

Answer:

# include <stdio.h>

# include "math.h"

void primeFactors(int n)

{

printf("The prime factorization of n is: ");

int flag=0;

while (n%2 == 0)

{

if ( flag == 1 ) printf("*");

else flag=1;

printf("%d", 2);

n = n/2;

}

int i = 3;

for (i; i <= sqrt(n); i = i+2)  

{

while (n%i == 0)

{

if(flag==1) printf("*");

else flag=1;

printf("%d", i);

n = n/i;

}

}

if (n > 2){

if(flag==1) printf("*");

else flag=1;

printf ("%d", n);

}

}

int main()

{

int n = 0;

printf("Enter Number: ");

scanf("%i",&n);

primeFactors(n);

printf("\n");

return 0;  

}

Explanation:

  • Create a function to print all prime factors of a given number n
  • Print the number of 2s that divide n  and n must be odd at this point. So we can skip one element.
  • While i divides n, print i and divide n
  • Apply condition to handle the case when n is a prime number.
You might be interested in
ystem, the design of which was developed using customary structured methods. To manage the intricacy of the application developm
Soloha48 [4]

Answer:

Organized plan is utilized to change the auxiliary examination (for example modules and their interrelation) into a straightforward graphical structure. It is essentially done in two stages:  

1. Transform Analysis  

2. Transaction Analysis  

For showing control stream in organized investigation we use Flow diagrams, But for indicated choice in organized examination, we frequently use choice tree. In choice tree we use hover for current state. An example decision tree is attached with the appropriate response, benevolently allude the equivalent.

4 0
3 years ago
Jack is assisting his younger sibling Mary with her mathematics assignment, which includes a study of the number system. Jack ex
Elza [17]

Answer:

The answer is A). Integers

Explanation:

Booleans and Strings don't represent numbers (in most cases) so they can be eliminated.

Floats are used for representing decimals while integers are used for whole numbers.

4 0
3 years ago
Read 2 more answers
What is RAM? explain it
Zina [86]
RAM is memory in the computer
3 0
3 years ago
Read 2 more answers
a benefit of cloud computing is scaling up or down as demand for your services increases or decreases. the word that is most ass
dalvyx [7]

The word that is most associated with this feature is Containerization, which has the benefit of cloud computing.

For software programs to run in segregated user spaces known as containers in any cloud or non-cloud environment, regardless of kind or vendor, containerization is operating system-level virtualization or application-level virtualization over numerous network resources.

Why is cloud computing used?

A wide range of use cases, including data backup, disaster recovery, email, virtual desktops, software development and testing, big data analytics, and customer-facing web apps, are being used by businesses of every size, type, and sector.

Because they don't contain operating system images, containers use fewer system resources than conventional or hardware virtual machine environments.

Therefore, Containerization is the feature most associated.

To learn more about Cloud Computing from the given link

brainly.com/question/19057393

#SPJ4

8 0
1 year ago
A computer is completely compromised when it wont turn on or operate. What is the best way to fix
miskamm [114]

There really is no getting it back, if it is from a virus, then you need to buy a new computer. If it is something internal, depending on what type of computer you have it might just be best to buy a new one. Hope this helps :-)

8 0
3 years ago
Read 2 more answers
Other questions:
  • What type of organism forms the base of food webs?
    9·1 answer
  • Helps locate Web pages
    7·1 answer
  • Create an application containing an array that stores eight integers. The application should call five methods that in turn (1)
    7·1 answer
  • You have observed that it is possible that some of your organization's projects may end up having little or no value after they
    11·1 answer
  • Grading on the curve is a method of grading that is based on the belief that letter grades for any given class should be distrib
    8·1 answer
  • Whers the main characteristic of a Peer-to-peer (P2P) network?
    14·1 answer
  • ______ norms are usually unstated rules that regulate members' interaction.
    12·1 answer
  • Need help fast this is do a 4
    5·1 answer
  • When text is used as a Hyperlink, it is usually underlined and appears as a different color.
    11·1 answer
  • _____ is a system in which a finite set of words can be combined to generate an infinite number of sentences.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!