i need help in adding the c++ code for the average mark, highest mark, lowest mark, number of students passing, using array

  #include<iostream>
  using namespace std;
  int main()
  {
      int gradeRange [4]= {0,0,0,0};
      int mark = 0;
      int counter = 0;

      while (mark < 101)
      {

         cin >> mark;
         if (mark > 100)
  break;
  if (mark >= 70)
  gradeRange [3] ++;
  else if (mark >= 40)
  gradeRange [2] ++;
  else if (mark >= 30)
  gradeRange [1] ++;
  else
  gradeRange [0] ++;

  }
  while (counter < 4)

  {
  if (counter == 0)
  cout << "0 - 29 ";
  else if (counter == 1)
  cout << "30 - 39 ";
  else if (counter == 2)
  cout << "40 - 69 ";
  else
  cout << "70 - 100 ";
  for ( int i = 1; i <= gradeRange [counter] ; i ++)
  {
  cout << "*";
  }
  counter ++;
  cout << endl;
  }

  system("PAUSE");
  }

You really should google more before posting. Look, I found a thread with a guy having the exact same code and a very similar problem to the one you're having. Considering the degree of similarity, I believe the replies he got should also be applicable to your case.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.