Advertisement
AchkataJo

Untitled

Nov 21st, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. int is_prime(int x)
  3. {
  4. int i,c = 0;
  5. for (i = 1; i <= x; i++)
  6. {
  7. if (x % i == 0)
  8. {
  9. c++;
  10. printf("%d has divider %d\n",x, i);
  11. }
  12. }
  13. printf("The dividers count is: %d",c);
  14. }
  15. int main()
  16. {
  17. int x;
  18. printf("Wirite number ");
  19. scanf("\n%d",&x);
  20. is_prime(x);
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement