#include <stdio.h> #include <math.h> int main() { int n; system("chcp 1251"); printf("Введите целое число\t"); scanf_s("%d", &n); for (int i = 2; i < sqrt(n) + 0.00001; ) { if (n % i == 0) { printf("%d ", i); n /= i; } else { ++i; } } if (n > 1) printf("%d", n); getchar(); getchar(); return 0; }
Here is a simple C code that prints the prime dividers of a number.
Example: 2600 = 2 * 2 * 2 * 5 * 5 * 13. So, why is sqrt (n) + 0.00001 written in for'e?