Skip to content

Instantly share code, notes, and snippets.

@ameeruljunaidi
Created January 29, 2022 21:41
Show Gist options
  • Save ameeruljunaidi/340e1691006798ed3ea52f848c7527bb to your computer and use it in GitHub Desktop.
Save ameeruljunaidi/340e1691006798ed3ea52f848c7527bb to your computer and use it in GitHub Desktop.
#include <stdio.h>
void factorize(int n)
{
int number = n;
int divisor = 2;
while (number != 1)
{
if (number % divisor == 0)
{
printf("%d ", divisor);
number /= divisor;
}
else divisor++;
}
}
int main()
{
factorize(50);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment