Merge pull request #192 from Manoj7117/patch-1

number invalid if number >= base
This commit is contained in:
Ashwek Swamy 2019-03-22 08:42:42 +05:30 committed by GitHub
commit 2fde23c6ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,8 +25,10 @@ int main(void) {
else else
number[i] = base + 1; number[i] = base + 1;
if (number[i] > base) if (number[i] >= base){
printf("invalid number\n"); printf("invalid number\n");
return 0;
}
} }
for (j = 0; j < i; j++) { for (j = 0; j < i; j++) {