C++ PROGRAM TO DISPLAY THE FACTORS OF THE ENTERED NUMBER

No comments

/*C++ PROGRAM TO DISPLAY THE FACTORS OF THE ENTERED NUMBER */


#include<iostream.h>
using namespace std;

intmain()
{
int number, temp =1;

cout<<"Enter the number to determine its factors : "<<endl;
cin>> number;
cout<<"The factors of "<< number <<" are : "<<endl;
while(temp <= number)
{
if(not(number % temp))
cout<< temp <<" ";

        temp++;
}
cout<<endl;
}

Output :-


No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀