getting wrong lowest value , if i separate the lowest and high (for) loop then i get the correct lowest value : in 3rd for loop comparison is made for smallest and largest element , i get the wrong value for smallest element . but why i don't understand.
if i divide 3rd loop into 2 for loop, one for lowest element and one for highest element,then i get the correct answer.

     #include <iostream>

     using namespace std;

         int main()
            {
               float rainfall[12];
               float total = 0.0;
               float avg = 0.0;
               float high,lowest;

               
              for(int i = 0; i<12; i++)
               {
                  cin>>rainfall[i];
                }

                    high = rainfall[0];
                    lowest = rainfall[0];

                    for (int i=0; i<12; i++)
                      {
                        total = total+rainfall[i];
                          avg = total/12;
                      }

                     for(int i=0; i<12; i++)
                      {


                           if(rainfall[i+1]<lowest)
                              {
                                lowest = rainfall[i+1];
                             }

                            if(rainfall[i+1]>high)
                             {
                                high = rainfall[i+1];

                              }
                          }
                                 cout.setf(ios::fixed);
                                cout.setf(ios::showpoint);
                                cout.precision(2); 
                                cout<<total<<endl;
                                 cout<<avg<<endl;
                                 cout<<high<<endl;
                                 cout<<lowest<<endl;
                               return 0;
                                