spaces ) then do 5 different things with those numbers; determine the maximum, average, range, and mode and then make a histogram ( which i already did that one ) this is everything in my program so far.

#include<iostream> #include <cstdlib> #include <string> using namespace std; int main() { // delare variables float r[50]; float all=0; float average = 0; string c1; string c2; string c3; string c4; string c5; string c6; string c7; string c8; string c9; string c10; // in this for loop im using string to show the amount of times // a number within a group of numbers apeared using a table. for (int c=0; c<=50; c++) { // randomization r[c]= rand() % 50; // nums 1-5 if ( r[c]>0 && r[c]<6 ) { c1 += "*"; } // nums 6-10 else if ( r[c]>5 && r[c]<11 ) { c2 += "*"; } // nums 11-15 else if ( r[c]>10 && r[c]<16 ) { c3 += "*"; } // nums 16-20 else if ( r[c]>15 && r[c]<21 ) { c4 += "*"; } // nums 21-25 else if ( r[c]>20 && r[c]<26 ) { c5 += "*"; } // nums 1-30 else if ( r[c]>25 && r[c]<31 ) { c6 += "*"; } // nums 31-35 else if ( r[c]>30 && r[c]<36 ) { c7 += "*"; } // nums 36-40 else if ( r[c]>35 && r[c]<41 ) { c8 += "*"; } // nums 41-45 else if ( r[c]>40 && r[c]<46 ) { c9 += "*"; } // nums 46-50 else { c10 += "*"; } } cout << endl << " This is the bar graph im using to display and compare how many times a" << endl; cout << " number apeared in groups of 5's of 1-50."; // this is the output in bargraph form of all numbers 1-50 cout << endl << " 1-5: " << c1 << endl; cout << " 6-10; " << c2 << endl; cout << " 11-15: " << c3 << endl; cout << " 16-20: " << c4 << endl; cout << " 21-25: " << c5 << endl; cout << " 26-30: " << c6 << endl; cout << " 31-35: " << c7 << endl; cout << " 36-40: " << c8 << endl; cout << " 41-45: " << c9 << endl; cout << " 46-50: " << c10 << endl << endl; cout << " This is the average of all 50 numbers: "; // all numbers going into one variable for (c=0; c==50; c++) { all += r[c]; } // average average = all / 50; cout << average << endl; // mode for (c=0; c==50; c++) { } return (0); }

im not getting any errors but the "all" variable is apearently = to 0 and i have no idea how to do mode but i do know how to do the others. this sucks some one help me! wahhh! i really need help with mode.

oh and i need some one to teach me how to put string in this program to. thank u!