Here's what the code should look like (no error checking, which you should add):
int main()
{
int numberM =0, numberN=0, i=0;
printf("Enter m: ");
scanf("%d", &numberM);
printf("Enter n: ");
scanf("%d", &numberN);
for(i = (numberM +1); i<numberN; i++)
printf("%d\n", i);
return 0;
}
Things you should know that were replaced and why:
1) All
std
namespace objects and functions are C++, they were replaced with appropriate printf/scanf calls.
2) In C, all variable declarations must occur at the beginning of the function, not the case with C++.
What's lacking in this code:
1) Checking for errors
2)
scanf
is NOT type safe, meaning the result of a user putting in the wrong input type is undefined