Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

Write short program that uses a for loop to populate an array

Write short program that uses a for loop to populate an array. The array can store up to 10 integers.

Modify the code slightly to create bug that would prevent the code from compiling or even better from running correctly.

Be sure to describe what the code is designed to do. Monitor the post to comment when other students work to repair your code.

Respond to one other student post by correcting their code and explaining what was corrected.

Only respond to one student so everyone will have an opportunity to fix some code.

The following code needs to be corrected and explain what was corrected:

#include <stdio.h>

int main() {

int i, fib[1];

fib[0] = 0;

fib[1] = 1;

for( i = 2; i < 10; i++ ) {

fib[i] = fib[i – 2] + fib[i – 1];

}

for( i = 0; i < 10; i++ ) {

printf( “Fibonacci[%d] = %d\n”, i, fib[i]);

}

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"