can some one tell me whats wrong with this program. i'm trying to find average of 10 floats and how do i use code tags?
Code:#include <iostream.h> #include <iomanip.h> void main() { // declare all variables float a[10]; // ask user for numbers cout << "What are the floating point numbers?" << endl; cin >> a[10]; float average; average = ((a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]+a[9]+a[10])/10); cout << "The average is " << average << endl; }