Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created August 27, 2021 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/6d6b8bce19af5e50549d2571929f951a to your computer and use it in GitHub Desktop.
Save amankharwal/6d6b8bce19af5e50549d2571929f951a to your computer and use it in GitHub Desktop.
#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