Well, if you do copy the code you've just posted, it won't run and will give an error message because you missed giving the counter "i" a name in your loop.
for ( int = 10; i > 0; i--) --> int i, not just int
Ok. What's happening in the loop is that i is going to decrement by 1 as long as it's greater than 0 and then be multiplied by 2.
1st iteration: i = 10 and 10 > 0 --->> output: 10*2 = 20
2st iteration: i = 9 and 9 > 0 --->> output: 9*2 = 18
it will keep going until the condition is met in your loop. That'll be the 10th iteration when the condition is met.
10th iteration: ---->> output: 1*2 = 2
I hope this helps you with understanding for-loops.. They can be quite tricky!
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...