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]
3 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]3 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]3 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
Which benefit does the cloud provide to star-up companies without access to large funding?
Nostrana [21]

Explanation:

Start-up companies can store, manage, process data and use programs through a web-based interface – something that greatly reduces costs. Data stored in the cloud can be accessed from anywhere through various devices with web connectivity, which is an advantage for small companies that don't have a huge IT budget.

4 0
3 years ago
In social networking websites such as twitter, people leave narrow minded and subjective remarks and upload unacceptable videos.
koban [17]
The advice is That you Message Them To remind Them Those Type of posts are not appropriate if people on social Media say bad Things To you you block Them if people don’t Treat you nice
8 0
3 years ago
Select the correct answer.
GrogVix [38]

Answer:

png or jpg

Explanation:

7 0
3 years ago
WHAT DOES THE SCRATCH CODE BELOW DO?
Natasha_Volkova [10]

Answer:

the first one

Explanation:

3 0
3 years ago
True or False?If you live in a country that uses censorship,you may not be able to access certain websites.ONLY ANSWER IF UR 100
Fed [463]

Answer:

TRUE! can i get brainliiest?

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • WordArt styles allow you to add ____.
    9·1 answer
  • For Official Use Only (FOUO) and Controlled Unclassified Information (CUI) may include all of the following except: (circle one)
    10·1 answer
  • Jake is preparing his resume. He is applying for the position of iOS application developer at a large software company. He wants
    6·1 answer
  • HELP PLEASE ASAP!!! Does anyone know how to fix a broken iPhone which when I connect it to the charger it comes up with the Appl
    5·1 answer
  • If the speakers are not working on a laptop, what could be the problem besides the speakers?
    5·1 answer
  • Which of the following is a scam in which a perpetrator sends an official looking e-mail that attempts to obtain a user’s person
    7·2 answers
  • A device that connects to a network without the use of cables is said to be?​
    13·1 answer
  • What is computer? Write is features <br><br><br><br><br>​
    14·1 answer
  • What technological development happened most recently?
    12·2 answers
  • Write javascript code for the form that appears in the image below. you are expected to add validation to the name field, email
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!