Skip to content

Instantly share code, notes, and snippets.

@cohalz
Created October 1, 2013 04:42
Show Gist options
  • Save cohalz/6773948 to your computer and use it in GitHub Desktop.
Save cohalz/6773948 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(){
int n,i;
printf("n = ");
scanf("%d", &n);
while(n != 1){
for(i=2;i<=n;i++){
if(n%i == 0){
printf("%d ",i);
n /= i;
break;
}
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment