From the course: Complete Guide to C Programming Foundations

Unlock the full course today

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

Challenge: Constructing a structure

Challenge: Constructing a structure - C Tutorial

From the course: Complete Guide to C Programming Foundations

Challenge: Constructing a structure

(light music) - [Instructor] For this challenge, your task is to write a program that contains a structure. The structure contains your birthday, your height in kilometers, and your name. Make your birthday a nested structure with three members, day, month, year. Your height in kilometers is a real number. And your name is a string. Declare the structure variable, and assign to that structure variable members, the data that describes yourself. You can choose to assign values directly when the structure variable is declared, or you can assign them later. Use a printf statement to output the structure values like this. George Washington was born on February 22nd, 1732, and he's this number kilometers tall. But make the data about yourself, not President Washington. A source code skeleton is provided in the exercise files to help get you started. This task should take about 10 minutes to complete.

Contents