Computer Science, asked by sahir70371, 9 months ago

Write a program to input an integer and count number of factors

Answers

Answered by Anonymous
1

Answer:

hi... its a python program

Explanation:

n=int(input("enter a number"))

for i in range(1,n):

   if n%i==0:

       print(i,end=" ")

#hope it helps you

please mark brainliest

Answered by gmaggie547
0

Answer:

Program by using Modularity Approach.

LOGIC---- first take input from user (int input)

then perform logic on given input----

factors of 12 are ---  12 % 1 to 100  , use modulo(%) for complete division.

                            ---1 , 2 , 3 , 4 , 6 , 12

> use for loop from number 1 to 100

> perform calculation on input number ( use if (input % 1 to 100==0) )

Explanation:

#include<stdio.h>

void factor(int);

main()

{

 int input;

 // take input from user

 printf("ENTER THE NUMBER : ");

 scanf("%d",&input);

 //call function

factor(input);

 return 0;

}

// function for count number of factors

void factor(int n)

   {

       int i;

       printf("count factors of given value :");

       for(i=1;i<=100;i++)

          {

              if(n%i==0)

        printf("%d ",i);

   }

   }

                                // hope you all ,

                                 //   will like it ,

                                 //  : )

Similar questions