Answer to Question #215374 in C++ for Zura

Question #215374
//what is the error in this program??
#include <iostream>
#define size 5 
using namespace std;  
int main () { 
int numbers=(5,10,15,20,25,30,35,40};            double total, average;
for (int i;i <size;i++) 
   total+= numbers; 
average = total/size; 
cout << "Average" << average << endl; 
return 0; 
}
1
Expert's answer
2021-07-08T15:44:48-0400

The counter variable i was not initialized.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS