Tuesday, March 5, 2024

30.Count total number of factors :—

 30.Count total number of factors :—

#include<stdio.h>

int main()

{

    int i,n,r,count;

    printf("enter a value of n ");

    scanf("%d",&n);

    count=0;

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

    {

        r=n%i;

        if(r==0)

        {

            count++;

        }

    }

    printf("%d",count);

    return 0;

}

No comments:

Post a Comment