This code segment first accepts a range of values in variables m and n, both of type int. The variable num, also of type int, is used as the loop variable. It assumes values from m to n. For each value of loop variable num, the printf statement within the for loop is executed.
Thus, all the numbers from m to n are printed. Observe the space character after the %d format in the printf statement. This causes a space to be printed after each value of num. The output is given below.
printf ("Enter range (m, n ) : ") ;
scanf ("%d %d", &m, &n);
for (num = m; num <= n; num++)
printf("%d ", num);