Learning by doing: Reading books and trying to understand the (code) examples
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
284 B

  1. #include <stdio.h>
  2. int main (void) {
  3. int number;
  4. int i;
  5. printf("Give a number: ");
  6. if (scanf("%d", &number) != 1) {
  7. printf("Not a number!\n");
  8. return 1;
  9. }
  10. i = number;
  11. while (i <= number + 10) {
  12. printf("%d ", i++);
  13. }
  14. printf("\n");
  15. return 0;
  16. }