Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
Krasimir committed Nov 25, 2024
1 parent e10e2c9 commit abbdfc8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions assignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ int is_positive_integer(const char *str) {
}

int main(int argc, char *argv[]) {
if (argc != 3) {
printf("Incorrect usage. You provided %d arguments. The correct number of arguments is 2\n", argc - 1);
if (argc == 1) {
printf("Incorrect usage. You provided 0 arguments. The correct number of arguments is 2\n");
return 1;
} else if (argc == 2) {
printf("Incorrect usage. You provided 1 arguments. The correct number of arguments is 2\n");
return 1;
} else if (argc > 3) {
printf("Incorrect usage. You provided 3 arguments. The correct number of arguments is 2\n");
return 1;
}

Expand Down

0 comments on commit abbdfc8

Please sign in to comment.