## Find the sum of 2 numbers

Write a method to find the sum of 2 numbers.

Example 1:

```
input data:
31 4
output:
35
```

Example 2:

```
input data:
17 -1
output:
16
```

**View Code Template**

**View Java Solution**

Skip to content
# Find the sum of 2 numbers

## Find the sum of 2 numbers

**View Code Template**

**View Java Solution**
###
2 thoughts on “Find the sum of 2 numbers”

Write a method to find the sum of 2 numbers.

Example 1:

```
input data:
31 4
output:
35
```

Example 2:

```
input data:
17 -1
output:
16
```

Comments are closed.

z = x + y ;

Lovely