Guest User

Untitled

a guest
May 20th, 2012
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int
  5. main(int argc, char *argv[])
  6. {
  7.  
  8. if (argc < 3)
  9. {
  10. printf("usage: %s <increment> <divider>\n", argv[0]);
  11. return 0;
  12. }
  13. int a = atoi(argv[1]);
  14. int b = atoi(argv[2]);
  15.  
  16. int i;
  17. int count = 0;
  18.  
  19. for (i = a; count < 3; i += a)
  20. {
  21. if (i % b == 0)
  22. {
  23. printf("%d\n", i);
  24. count++;
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment