Skip to content

Instantly share code, notes, and snippets.

@andraantariksa
Created February 12, 2019 09:57
Show Gist options
  • Save andraantariksa/55525e1cc6dd16f0d614341cbda098a7 to your computer and use it in GitHub Desktop.
Save andraantariksa/55525e1cc6dd16f0d614341cbda098a7 to your computer and use it in GitHub Desktop.
Assignment Structured Programming 3
/*input
36
*/
#include <iostream>
#include <cmath>
int main(int argc, char const *argv[]){
int n;
std::cout<<"Calculate factor of: ";
std::cin>>n;
std::cout<<std::endl;
for(int i = 1; i <= (int)sqrt(n); i++){
if(n%i == 0){
std::cout<<i<<"*"<<n/i<<std::endl;
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment