Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <stdio.h>
- # include <math.h>
- void primeFactors(int n);
- int main()
- {
- int n;
- printf("number de do bhaiyma plis. UwU");
- scanf("%d",&n);
- primeFactors(n);
- return 0;
- }
- void primeFactors(int n)
- {
- while (n%2 == 0)
- {
- printf("%d ", 2);
- n = n/2;
- }
- for (int i = 3; i <= sqrt(n); i = i+2)
- {
- while (n%i == 0)
- {
- printf("%d ", i);
- n = n/i;
- }
- }
- if (n > 2)
- printf ("%d ", n);
- }
- //gcc Q6.c -o Q6 -lm
- // ./Q6
Advertisement
Add Comment
Please, Sign In to add comment