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
Su prepares a presentation about the industrial revolution. She wants to change the font on the second slide of
tatyana61 [14]

Answer:

The answer to this question with an explanation is given below in the explanation section

Explanation:

Sue prepares a presentation about the industrial revolution. She wants to change the font on the second slide of her presentation. She can accomplish this task with the following option.

By using Font dialog box

Using this option, first, she needs to select the whole second line, as the line gets selected, font dialog box get appear, wherefrom she can change the font to any available font style, size. In this font dialog box, she can also increase and decrease the font, change the font color and can make font bold, italic and underline.

By using the Font drop-down menu

Using this option, first, she needs to select the second line of her slide. Then, go to the Home tab, under Font group section, she can change the font style, size, color and increase spacing, etc.

Why other options are not correct.

<em>By using the mini toolbar</em>

mini toolbar does not have the option that directly allows you to change the font

<em>By using paragraph option</em>

Using this option, you can only modify the paragraph setting, but not the font. Using this option, you can align the text of paragraph to center, left, right and justify, you can do numbering, add or remove the column, and make text direction.

<em>By using WordArt options</em>

Using this option, you can insert WordArt, these styles are predefined and don't allow you to change the font.

6 0
3 years ago
Read 2 more answers
Write a program that asks length and breadth of a rectangle a calculate its area qbasic​
Natasha_Volkova [10]

Answer:

INPUT "Enter the length";l

INPUT "Enter the width";w

PRINT "The area is ";l*w

5 0
3 years ago
What are two reasons network devices are typically accessed through a cli?
belka [17]

The CLI is the main, text-based interface for setup, administering, and checking network tools such as a router or a switch hub. CLI allows you to transcribe in composition commands to get the output from the router or a switch hub. The network application software recognizes the command when you input the exact characters of the command to essentially identify it, which in turn helps you check the status of your network device.

7 0
3 years ago
Why is it necessary to clear the cache before you retest the web server connections?
egoroff_w [7]
The cache stores copies of content retrieved from the web. In stead of hitting your webserver, your test may be satisfied from the cache, so you are not testing any changes that you made...

CSS files are notoriously stubborn in their caching behaviour.
7 0
3 years ago
What line of code would you edit if you wanted a bigger sprite?This is computer science.Pick branliest if right
Effectus [21]
Pretty sure the answer is a-3
5 0
3 years ago
Read 2 more answers
Other questions:
  • Mark’s friends told him about an automated program that sends unsolicited messages to multiple users. Which type of program were
    11·2 answers
  • Ben is writing web page content on a newly launched gaming gadget. He has to use hyperlinks to help visitors navigate to web pag
    11·1 answer
  • Suppose you are currently in the /home/hnewman/os/fall/2013 directory and would like to navigate to /home/hnewman/discreteStruct
    9·1 answer
  • You've decided to use a subnet mask of 255.255.192.0 with your 172.17.0.0 network to create four separate subnets. The network I
    13·1 answer
  • You are given a class named Clock that has three instance variables: One of type int called hours, another of type boolean calle
    11·1 answer
  • Tcp takes a three-step approach to establishing a reliable communication. first, from the transport layer of the sending device
    12·1 answer
  • interpret the following SQL create table persons (person I'd int, last name varchar (255) first name varchar (255) address varch
    7·1 answer
  • Implement the ArrayMethod application containing an array that stores eight integers. The application should call the following
    12·1 answer
  • Put these operating systems in order according to the date they were released. (The first to be released would be
    10·1 answer
  • What's good computing?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!