Challenge

The interior angles of a triangle must add up to 180 degrees. Create a new C Command Line Tool named Triangle. In main.c, write a function that takes the first two angles and returns the third. Here is what it will look like when you call it:

#​i​n​c​l​u​d​e​ ​<​s​t​d​i​o​.​h​>​ /​/​ ​A​d​d​ ​y​o​u​r​ ​n​e​w​ ​f​u​n​c​t​i​o​n​ ​h​e​r​e​ i​n​t​ ​m​a​i​n​(​i​n​t​ ​a​r​g​c​,​ ​c​o​n​s​t​ ​c​h​a​r​ ​*​ ​a​r​g​v​[​]​)​ {​ ​ ​ ​ ​f​l​o​a​t​ ​a​n​g​l​e​A​ ​=​ ​3​0​.​0​;​ ​ ​ ​ ​f​l​o​a​t​ ​a​n​g​l​e​B​ ​=​ ​6​0​.​0​;​ ​ ​ ​ ​f​l​o​a​t​ ​a​n​g​l​e​C​ ​=​ ​r​e​m​a​i​n​i​n​g​A​n​g​l​e​(​a​n​g​l​e​A​,​ ​a​n​g​l​e​B​)​;​ ​ ​ ​ ​p​r​i​n​t​f​(​"​T​h​e​ ​t​h​i​r​d​ ​a​n​g​l​e​ ​i​s​ ​%​.​2​f​\​n​"​,​ ​a​n​g​l​e​C​)​;​ ​ ​ ​ ​r​e​t​u​r​n​ ...

Get Objective-C Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.