C uses printf() for output. Include <stdio.h> for standard I/O.
C
Learn the foundation of programming.
Hello World
Run this example to see how it works and then try the exercise.
Click "Run" to see the example in action...Your task: Use printf() to print "Hello, World!"
Click "Run" to execute your code...What does stdio.h stand for?
SUMMARY
In this section, you learned how to print output to the console. Next, you'll learn how to declare variables and work with different data types.
Variables and Data Types
C has basic types. Use format specifiers in printf.
Run this example to see how it works and then try the exercise.
Click "Run" to see the example in action...Your task: Declare age (int), height (float), grade (char)
Click "Run" to execute your code...Which format specifier is used for integers in C?
SUMMARY
In this section, you learned how to declare variables and work with different data types. Next, you'll learn how to use constants for values that don't change.
Constants
Constants are values that cannot change. Use const or #define.
Run this example to see how it works and then try the exercise.
Click "Run" to see the example in action...Your task: Calculate area using PI * radius * radius
Click "Run" to execute your code...Which keyword creates a constant variable in C?
SUMMARY
In this section, you learned how to use constants for values that don't change. Next, you'll learn how to perform mathematical operations.
Unlock 10 More Lessons
You've completed the free preview! Upgrade to Pro to access all 12 lessons in this course, plus advanced projects and certificates.
- Arithmetic Operators
- If-Else Statements
- For Loops
- While Loops
- Functions
- Arrays
- Pointers
- Structs
- Final Project: Student Grade System