Challenge
Welcome to your first challenge!
Most chapters in this book will finish with a challenge exercise to do on your own. Some challenges (like the one you are about to do) are easy and provide practice doing the same thing you did in the chapter. Other challenges are harder and require more problem-solving. Doing these exercises cements what you have learned and builds confidence in your skills. We cannot encourage you enough to take them on.
(If you get stuck while working on a challenge, take a break and come back and try again fresh. If that does not work, visit the forum for this book at forums.bignerdranch.com for help.)
Create a new C Command Line Tool named TwoFloats. In its main() function, declare two variables of type float and assign each of them a number with a decimal point, like 3.14 or 42.0. Declare another variable of type double and assign it the sum of the two floats. Print the result using printf(). Refer to the code in this chapter if you need to check your syntax.