So I have to write a list of while loops for my obj. oriented class proj.
I cant figure out how to write these:
You dont need to give the answer I just need clarification, ie. example.
// Output: (n - 1) ... 7 4 1
// Output: 1 2 3 ... (n / 2)
// Output: -(n / 2) ... -2 -1 0
// Output: -(n / 2) ... -2 -1 0 1 2 ... (n / 2)
// Output: 1 2 4 ... 2^(n - 1)
// First n powers of 2
// Output: 1 2 6 24 120 ... (n - 1)!
// First n factorials
// Output: 1 -1 1 -1 ... 1 -1
// Length of output is n
// Output: 0 1 0 1 ... 0 1
// Length of output is n
// Output: 0 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10
// Goes up by 2 and then down by 1 alternatively
I cant figure out how to write these:
You dont need to give the answer I just need clarification, ie. example.
// Output: (n - 1) ... 7 4 1
// Output: 1 2 3 ... (n / 2)
// Output: -(n / 2) ... -2 -1 0
// Output: -(n / 2) ... -2 -1 0 1 2 ... (n / 2)
// Output: 1 2 4 ... 2^(n - 1)
// First n powers of 2
// Output: 1 2 6 24 120 ... (n - 1)!
// First n factorials
// Output: 1 -1 1 -1 ... 1 -1
// Length of output is n
// Output: 0 1 0 1 ... 0 1
// Length of output is n
// Output: 0 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10
// Goes up by 2 and then down by 1 alternatively