From the course: Complete Guide to C Programming Foundations

Unlock the full course today

Join today to access over 24,300 courses taught by industry experts.

Chapter challenge: Adding variables and constants

Chapter challenge: Adding variables and constants - C Tutorial

From the course: Complete Guide to C Programming Foundations

Chapter challenge: Adding variables and constants

(light music) - [Instructor] Time to put your variable and constant declaration skills to work. I'm providing this source code skeleton for you found in the exercise files. Your task is to replace the comments with proper C language statements, declarations here, assignments here, and output statements here. The text is provided in the double quote part of each comment. Your task is to replace the comments with C statements. First, declare the constant and variables of the proper data types. The suggested names are shown in the comments. Then assign values to the variables. Finally, output the values as shown in the last set of comments. Here are some hints, the constant value must be equal to three quarter. The variable values can be whatever you like. No math is performed. Real number output formatting is hinted at in the comments though you can use whatever format you like. This challenge should take you about five minutes to complete.

Contents