### Daily Challenge #84 - Third Angle of a Triangle

#### dev.to staff on October 07, 2019

You are given two angles of a triangle in degrees.
Write a function to return the third angle. Only positive integers will be tested.
Sample Test...
[Read Full]

ANSI C

Run with

`~$ gcc -lm <file_name> && ./a.out`

My solution in js

What happens if I enter

`thirdAngle(0,0)`

?Good catch. Edited. But the challenge is to deal with positive integers so didn't take 0 into account as it is neither positive nor negative integer.

True enough. But why code purely for specs when coding for the edge and error cases takes just a few more minutes?

## Solution in APL

(using Dyalog APL)

## Tests:

Try it online!

ElmTest it onlineHere.

Keeping it simple in bash

Running through the examples on the cmd:

BTW the challenge on Kata only tests for valid triangles,

was sufficient in JS

In Go!

Go Playground

This oughta do it for Elixir.

What happens if I enter

`thirdAngle(0,0)`

?you are right, I just wrote it very fast and I did not think about this case.

TDD will help a lot in these situations.