Taking 2 command line inputs and verifying that they are integers, within the correct range of values
This is unrelated to performance, but it may still be helpful in general:


You should print those errors to stderr via fprintf():

fprintf(stderr, "Warning: Check number of arguments.\n");




fprintf(stderr, "Warning: Please enter a valid integer.\n");




fprintf(stderr, "Warning: Bad input.\n");

Are you using a pre-C99 version of C?  If not, you should be initializing the loop counter variables within the loop conditions, not outside of them.
It's common to provide the types of expected arguments (starting with whatever gets printed from argv[0]) if this check fails. You could also specify the number of expected arguments so that the user isn't left guessing, in case the objective isn't already clear.

fprintf(stderr, "Warning: Check number of arguments (must be 2).\n");

You shouldn't try to do everything in main(), and it doesn't look like those checks after the arguments check belong there.

Instead, consider providing separate functions for both that get called from main(). They can return a boolean value and, if it's an erroneous one, the program can then terminate from main().
If I'm not mistaken, the for loop is supposed to check both argv[1] and argv[2] for valid data types.

If so, you could either:


Do two separate checks without a loop (to maybe make it a little more cleaner)
If you may consider expanding it for additional arguments, use argc as part of the outer loop sentinel value instead of hard-coding the 2 (which could be seen as a "magic number" instead anyway)