Numbers are classified in C as whole number values or integers as well as real numbers that contain a decimal portion or are very small or very large. Expressing numbers properly in C is important, not only to match up the data type but to use the proper format when typing the literal value.
- [Instructor] Numbers in C come in two flavors: … the int data type stores integers or whole number values … and the float or doubled data types store, real numbers … are those that contain a decimal portion … or a very large or very small. … Integers in your code are written without commas … for large values as shown here at line five. … Real numbers always specify the decimal part. … At line six, a float variable is declared … and the 0. is required. … You can't just do .25. Well, maybe a can. … Always put the zero in there to show that the value … is a real number. … And at line seven, the value 1 billion adds on the .0 again … to tell the compiler that this is a real number … and not the integer value 1 billion. … This exercise file provides a quick test. … Build and run. And I'm going to type 100 million. … And you see that it works. … Now, I'm going to run it again. … And this time I'm going to type the commas, … just as you would when you write someone a check, though, … not for a value of this big. …
- Writing your first C program
- Working the C development cycle
- Adding comments to code for clarity
- C language data types
- Declaring variables
- Making new data types
- Typecasting variables
- Using math, assignment, and logical operators
- Creating for and while loops
- Nesting loops
- Creating functions
- Returning values from functions
- Passing arguments to functions
- Creating recursive functions
Skill Level Intermediate
C: Data Structures, Pointers, and File Systemswith Dan Gookin2h 57m Intermediate
1. The Fundamentals of C
2. Variables and Values
3. Operators and Math
4. Decisions and Loops
Next steps1m 38s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.