When I run this C++ program that asks the user to enter thepopulation of 4 cities and produce the bar graph
- it runs but ends with a Debug Error - run time check failure 2stack around variable population was corrupted - any help would beappreciated
#include
using namespace std;
int main()
{
int population[4],k;
  int i=1,n=5;
 Â
  do
  {
      cout<<\"Enter thepopulation of city \"<
   Â
      cin>>population[i];
      if(population[i]<0)
      cout<<\"populationcannot be negative,Reenter\n\";
      else
      i++;
    }  while (i   Â
      cout<<\"\n\n\t\tPOPULATION\n\t  (each * = 1000people)\n\";
      for(int i=1;i  {
      cout<<\"\nCity\"<
      k=population[i]/1000;
      for(int j=0;j     cout<<\"*\";
  }
  return 0;
}