Created
February 12, 2019 09:57
-
-
Save andraantariksa/55525e1cc6dd16f0d614341cbda098a7 to your computer and use it in GitHub Desktop.
Assignment Structured Programming 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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