Write a C++ program to compute the sum of the two given integer values. If the two values are the same, then return triple their sum
- برمجة سي بلس بلس
- برمجة
- 2021-05-11
- MarwaMohammed
الأجوبة
#include <iostream>
using namespace std;
int test(int x, int y)
{
return x == y ? (x + y)*3 : x + y;
}
int main()
{
cout << test(1, 2) << endl;
cout << test(3, 2) << endl;
cout << test(2, 2) << endl;
return 0;
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال