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
Marina CMI [18]
2 years ago
14

Given an int as the input, print all the factors of that number, one in each line. For example, if the input is 15 The output wi

ll be 1 3 5\
Computers and Technology
2 answers:
sasho [114]2 years ago
5 0

Answer:

#include<iostream>

using namespace std;

int main()

{

int num, temp = 1;

cout << "Enter the number to determine its factors : " << endl;

cin >> num;

cout << "The factors of " << num << " are : " << endl;

while (temp <= num)

{

if (not(num % temp))

cout << temp << " ";

temp++;

}

cout << endl;

}

Explanation:

trapecia [35]2 years ago
4 0

Answer:

The program to calculate factor can be given as:

Program:

#include <stdio.h> //include header file

int main() //defining main function

{

   int a,i; //defining integer variable

   printf("Enter any number: "); //print message

   scanf("%d",&a); //input value from user end

   for(i=1;i<=a;i++) //loop for calculate factor values

   {

       if(a%i==0) //define condition for factor

       {

           printf("%d\n",i); //print values

       }

   }

   return 0;

}

Output:

Enter any number: 15

1

3

5

15

Explanation:

In the above C language program the header file is include that provide the use of basic function, in the next line the main method is defined, inside this method two integer variable "a and i" is defined in which variable a is used to take value from user end and variable i is used in loop and conditional statement.

  • In the next step, for loop is declare, that start from 1 and end with value of variable a, inside a loop, if block is used that checks (a%i==0), in this if variable i value modeler value equal to 0.  
  • The loop will use the print function that prints variable "i" element in a new line, which is the factor the values.  

You might be interested in
What is a collection of computing resources that are elastic and highly virtualized?
In-s [12.5K]

Answer:

private cloud

Explanation:

I just know

5 0
2 years ago
4. Why does Hancock believe that our communication online is more honest than we might<br> expect?
meriva

Answer:

The reason we are more honest online is simpler than we think, says Hancock. In the past, before there was modern technology or even written language, people could lie to each other easily. Once the words were said, they disappeared. ... Technology therefore might make us more honest than ever

6 0
2 years ago
Read 2 more answers
What is the difference between the Paste Special and Paste Link options?
kotegsom [21]
Paste Link lets you automatically update the referenced document.
8 0
3 years ago
Read 2 more answers
Where can a user find available templates and themes in PowerPoint?
jenyasd209 [6]

Can look under the design tab to find a handful of slide themes to choose from including an option to browse from to get a theme that you personally saved.

3 0
2 years ago
A "slideument" is:
Sophie [7]

Answer:

c. An electronic slide that tries to function as both a presentation visual and a printed document

Explanation:

Slideument combines both text and visual aids to form a document that can be fully understood by readers without the use of speakers when presenting these documents. It is a presentation with information containing visual aids and presented in form of slide deck so that it can be easily understood by readers.

8 0
2 years ago
Other questions:
  • William found out that someone used his report on American culture without his permission. What is William a victim of?
    13·2 answers
  • What does an SQL injection do
    12·2 answers
  • To hide gridline when you display or print a worksheet
    14·1 answer
  • Multiple client switches and routers have been set up at a small military base. The network team decided to implement Terminal A
    15·1 answer
  • Recovery after a disaster involves installing the most recent ________ backup copy.
    15·1 answer
  • Explain in details three security countermeasures you know.​
    10·1 answer
  • Computer A has an overall CPI of 1.3 and can be run at a clock rate of 600 MHz. Computer B has a CPI of 2.5 and can be run at a
    6·1 answer
  • Who wont me???????????????
    6·2 answers
  • Which version of java should i use?.
    13·1 answer
  • The internet is ________. an internal communication system for businesses a large network of networks a communication system for
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!