Advertisement
informaticage

calcolo divisori

Dec 8th, 2014
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main()
  4. {
  5.     int NUMBER;
  6.     int i = 0;
  7.     int resto = 0;
  8.     printf("Inserire NUM: ");
  9.     scanf("%d", &NUMBER);
  10.     printf("\nDivisori: \n");
  11.     while(i++ <= NUMBER)
  12.     {
  13.         resto = NUMBER%i;
  14.         if(resto == 0)
  15.             printf("%d \n",i);
  16.     }
  17.     system("pause >> null");
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement