Ok, a couple comments... It seems to me that length and sequence seem to be the same thing in your code...
The user could specify the following for your problem...
1. Starting number
2. Ending Number
3. Number of Numbers in the sequence
4. The incremental value
#2 and #3 are kind of mutually exclusive. In other words if they specify the ending number then specifying the number of numbers in the sequence doesn't make sense (unless you code it so that whichever happens first or last or something).
I'm assuming for the code below, that the user is specifying ONLY the number of numbers in the sequence...
Code:
int start_num = 0;
int curr_num = 0; //Holds the current number
int num_count = 0; //Number of numbers in the sequence
int increment_num = 0;
int x = 0; //Counter
// Get user input
curr_num = start_num;
for (x = 1; x <= num_count; x++) {
printf("%d\n", curr_num); // Print each number on it's own line
curr_number += increment_num;
}
The code would be slightly different if you want the user to specify the ending number in the sequence...
Code:
int start_num = 0;
int end_num = 0;
int increment_num = 0;
int x = 0; //Counter
// Get user input
for (x = start_num; x <= end_num; x += increment_num) {
printf("%d\n", x); // Print each number on it's own line
}
Of course if the user specifies an incremental value that will never count to the end number, then the end number will not be in the sequence, but the loop will stop when the bound is broken...
if the user specifies start_num = 1, end_num = 10, and increment_num = 2 then the sequence output will be 1, 3, 5, 7, 9.