When I'm trying to run the program and execute it the for loop doesn't repeat of an adequate form, when I'm trying to execute it appears me this:
Enter a number:
5.6
Enter a number:
Enter a number:
Enter a number:
Enter a number:
Enter a number:
Enter a number:
Enter a number:
Enter a number:
Enter a number:
I tried to search some information about this problem, but I don't found anything. I know that is a foolish question but I don't know where else to turn. A help is appreciated. I left you my code:
#include <iostream>
using namespace std;
int main (void){
int num, sum;
float average;
for(int i=0; i<10; i++){
cout << " Enter a number: " <<endl;
cin >>i;
sum += num;
}
average = num / 10;
cout << " The total average is:\n " << media <<endl;
}