Sum of odd number in given range using Command Line Programming

Please comment your own version of code in the comment section below –


#include <stdio.h>
#include <stdlib.h>

int main(int argc, char* argv[])
{

if(argc==1 || argc >3){
printf("Please enter only two arguemnts one lower limit and one upper limit");
return 0;
}

else {

int i, n,m, sum=0;
n=atoi(argv[1]);
m = atoi(argv[2]);
for(i=n; i<=m; i++)
{
if(i%2==1)
sum += i;
}

printf("Sum of odd numbers = %d", sum);
}
return 0;
}