From the course: C Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Build the foundation

Solution: Build the foundation - C Tutorial

From the course: C Essential Training

Start my 1-month free trial

Solution: Build the foundation

(upbeat music) - I'll forgive you if you didn't quite understand the course challenge and perhaps you didn't code things the way you see here in my solution. To review the task was first, to include the stdio and stdlib header files which you see here at lines one and two. Second, create the main function. Third, in the main function put a return statement that sends zero back to the operating system. Now this program doesn't technically do anything but it was a challenge. If you got these three parts correct, then you've provided a solid foundation for the rest of the course challenges. The second part of the challenge was to add comments, which you can see in this code. So line four introduces the main function, lines seven through nine which will eventually contain all the statements that do things in the code, they show three other comments. To get and verify input, to avoid out of range values, and to…

Contents