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
When a defendant pleads guilty to one offense just to have another offense dropped, this is what type of plea bargain
uranmaximum [27]
<h2>Answer:</h2>

The answer is sentenced plea bargain

<h2>Explanation:</h2>

sentence bargaining occurs when a defendant agrees to plead guilty to the stated charge in return for a lighter sentence. Typically this must be reviewed by a judge, and many jurisdictions simply don't allow it. In sentence bargaining, they plead guilty agreeing in advance what sentence will be given; however, this sentence can still be denied by the judge.

4 0
3 years ago
Read 2 more answers
In a graphical user interface, which is a small symbol on the screen whose location and shape changes as a user moves a pointing
ollegr [7]

Answer:

a pointer or cursor

Explanation:

6 0
3 years ago
If 200.123.4.6 is a classful internet protocol (ip) address, what class is it in?
REY [17]

200.123.4.6 is a classful internet protocol (ip) address located in class C.

An IP address (internet protocol address) is a numeric representation. This numerical representation uniquely identifies a particular interface on the network.

Address in IPv4 that has a length of 32 bits. This allows a maximum of 4,294,967,296 (232) unique addresses. Addresses in IPv6 are 128-bits long, which allows for 3.4 x 1038 (2128) unique addresses.

The total usable address pools of both versions are subtracted by the various reserved addresses and other considerations.

IP addresses can also be defined as binary numbers but are usually expressed in decimal form (IPv4) or hexadecimal form (IPv6) to make it easier for humans to read and use them.

You can learn more about IP addresses here brainly.com/question/18722788

#SPJ4

4 0
1 year ago
A smart refrigerator can use _____ to detect when you are running low on milk, and then send a reminder to you on a wireless net
Brilliant_brown [7]

Answer:

IoTs

Explanation:

4 0
3 years ago
Why is my speedtest is very good but chrome is slow
olga55 [171]
Maybe you have lots of tabs open
5 0
2 years ago
Other questions:
  • To calculate the chapter from which you must solve the programming exercise, divide the integer number representing your student
    10·1 answer
  • Switches operate on what layer of the OSI Model
    11·1 answer
  • The labels button is found under the
    7·2 answers
  • Gina is driving her car down the street. She has a teddy bear sitting on the back seat. A dog runs in front of Gina's car, so sh
    15·2 answers
  • Charles Mott works for a company called VeriSign that acts a trusted third party to verify information. One of Charles' largest
    15·1 answer
  • Why are object-oriented languages very popular?
    11·2 answers
  • Complete the sentence.
    5·1 answer
  • 11.6 Code Practice edhesive
    11·1 answer
  • Please Help, Thank you!
    5·1 answer
  • (40 PTS) Be specific
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!