Gopal

Gopal

  • NA
  • 135
  • 13.6k

Why the output is not 6?

Mar 6 2021 5:35 AM
  1. #include  
  2. #include  
  3. #include  
  4.   
  5. using namespace std;  
  6. int main() {  
  7.   vector heights = {  
  8.     100.3,  
  9.     120.8,  
  10.     132.7,  
  11.     160.4,  
  12.     150.3,  
  13.     144.9,  
  14.     170.5,  
  15.     125.6  
  16.   };  
  17.   auto myLambda = count_if(heights.begin(), heights.end(), [](int x) {  
  18.     return x > 125.00;  
  19.   });  
  20.   cout << "The number of participants will be: " << myLambda;  
  21.   return 0;  
  22. }  
The output:The number of participants will be: 5 [Program finished]Why the output is not 6?

Answers (3)