Advertisement
apfel2kuchen

C | Aufgaben 6 - x

Jul 21st, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1.  
  2. //Aufgabe 6
  3. #include<stdio.h>
  4. main()
  5. {
  6. int n1,n2, counter;
  7. printf("All numbers which divisible through 7\n");
  8. printf("First number: ");
  9. scanf("%d", &n1);
  10. printf("Second number: ");
  11. scanf("%d", &n2);
  12.  
  13. if (n1 > n2) {
  14. printf("Wrong feed");
  15. } else {
  16. counter = n1;
  17. while (n2 > counter) {
  18. if ((counter % 7) == 0) {
  19. printf("%d\n", counter);
  20. }
  21. ++counter;
  22. } //End While
  23. }
  24. printf("Finish");
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement