TECHXCODE Under Construction

C++ Program to find factors of a number

/* Program to find factors of a number */

#include<iostream>
#include<conio.h>
int main()
{
    using namespace std;
    int no,flag = 1;
    cout<<"Enter the number\t";
    cin>>no;
    for(int i = 1; i < no/i; i++)
        if(no%i==0)
            cout<<i<<" * "<<no/i<<" = "<<no<<endl;
    getch();
    return 0;
}

0 Comments:

Post a Comment

 
Copyright © . TECHXCODE.COM - Posts · Comments
Theme Template by BTDesigner · Powered by Blogger