-
What is the output of this program?
#include <iostream>
#include <functional>
#include <algorithm>
using namespace std;
int main ()
{
int num[] = {11, -22, -33, 44, -55, 66, -1};
int Calculate;
Calculate = count_if ( num, num + 7, bind2nd(less<int>(), 0) );
cout << Calculate;
return 0;
}
-
- 11
- 4
- -22
- -33
- -44
Correct Option: B
In this program, We are calculating the number of negative elements present in the program by using function objects.