There's an old joke: Why is 6 scared of 7? Because 7 8 9 (sevenate nine). But
Fantastic news! We've Found the answer you've been seeking!
Question:
There's an old joke: "Why is 6 scared of 7? Because 7 8 9 (sevenate nine)." But since hearing that joke, I've had an irrationalfear of the number 7. Write a templated function, called "safe_add"that adds two numbers (ints, floats, doubles, etc) and returnsthere sum. However, if either number (or their sum) contains thenumber 7, raise a runtime_error stating "can't add because 6+1appears in it".
Please code in C++, thank you!!
Test case 1:
Test case 2:
Test case 3:
Posted Date: