C#: Compute the sum of the two given integers
Sum is 18 if One Value in 10-20 Range
Write a C# Sharp program to compute the sum of the two given integers. Return 18 if one of the given integer values is in the range of 10..20 inclusive.
visual Presentation:

Sample Solution:-
C# Sharp Code:
Sample Output:
10 18 18 241
Flowchart:

For more Practice: Solve these Related Problems:
- Write a C# program that returns 25 if either of the two integers is in the 30–40 range.
- Write a C# program to return 0 if both integers are in the 10–20 range; otherwise return their sum.
- Write a C# program to return a constant value if any of the two integers fall in overlapping forbidden ranges.
- Write a C# program to return 18 if the absolute difference of two numbers falls in the 10–20 range.
Go to:
PREV : Within 2 of Multiple of 10.
NEXT : Fizz, Buzz, FizzBuzz.
C# Sharp Code Editor:
Improve this sample solution and post your code through Disqus
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.