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

This is for class CMIS 102 6983 Introduction to Problem Solving and Algorithm Design  (C programming) I need helping solving the below question.

This is for class CMIS 102 6983 Introduction to Problem Solving and Algorithm Design

(C programming) I need helping solving the below question.

1.The code below executes but who can explain how the result is derived?

#include <stdio.h>

int main()

{

int avg = 0;

int sum =0;

int x=0;

/* Array- declaration – length 4*/

int num[4];

/* The for loop is used to traverse through the array

* while storing the entered values in the array

*/

for (x=0; x==4;x++)

{

printf(“Enter number %d \n”, (x+1));

scanf(“%d”, &num[x]);

}

for (x=0; x<4;x++)

{

sum = sum+num[x];

}

avg = sum/4;

printf(“The average of these numbers is: %d”, avg);

return 0;

}

Reply to Thread

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