Thursday, September 22, 2016

Factors Of A Positive Number

Tags

Program to Calculate Factors of A Positive Number:

#include<iostream>
using namespace std;
main()
{
    int num,i;
    cout<<"Enter No To Find Its Factors\n";
    cin>>num;
    cout<<"\nFactors are:\n";
    for(i=1;i<=num;i++)
    {
        if(num%i==0)
        {
        cout<<i<<"\n";
        }
    }
}