Given the following function int strangeint x int y if x y
Given the following function: int strange(int x, int y) {if (x > y) return x + y; else return x - y;} what is the output of the following statement? cout
Solution
Program:
#include <iostream>
using namespace std;
int strange(int x, int y)
{
if(x>y)
return x+y;
else
return x-y;
}
int main()
{
cout<< strange(4,5) << endl;
return 0;
}
Output: - 1
Answer) Option a. -1
