Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Aug 27, 2021
Embed
What would you like to do?
#include <iostream>
using namespace std;
int main(){
int number;
int i;
cout << "Enter a number : ";
cin>>number;
for(i = 1; i <= number; ++i){
if(number % i == 0)
cout <<i<<endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment