I'm doing this for my homework. I'm scared that my code might end up getting too long and I might get some points off for inefficiency/having a code that's too long.
As of now, that code I posted above works like it's supposed to but I have this weird feeling that my code is the "long-cut"...
It's 19 lines of code, I don't think your Professor will get mad. Especially in programs as short as this, where the code is easy to follow it's more important for it to run efficiently. At the moment your calculations should be fine, I would say the only parts that will be CPU-Intensive is all of the output and the system commands. If you're really nervous that your code is too long/hard to follow, I would just add some comments in.
Personally, when I need to calculate the sequence I write it as follows:
1 2 3 4 5 6 7
int previous = -1;
int result = 1;
for( unsignedint i = 0; i <= n; ++i ) {
int sum = result + previous;
previous = result;
result = sum;
}