C Exercises
Exercises
Test your C skills with exercises from all categories:
Syntax
Statements
Output
New Lines
Comments
Variables
Format Specifiers
Change Values
Multiple Variables
Variable Names
Data Types
Character Data Types
Numeric Data Types
Decimal Precision
The sizeof Operator
Type Conversion
Constants
Operators
Booleans
If
Else
Else If
Short Hand If Else
Switch
While Loop
Do While Loop
For Loop
Nested Loops
Break and Continue
Arrays
Array Size
Multidimensional Arrays
Strings
Special Characters
String Functions
User Input
Memory Address
Pointers
Pointers and Arrays
Functions
Function Parameters
Scope
Function Declaration
Recursion
Math
Create Files
Write To Files
Read Files
Structures
Enums
Memory Management
Allocate Memory
Access Memory
Reallocate Memory
Deallocate Memory
Log in to track your progress
If you haven't already, sign up to become a W3Schooler, and get points for every exercise you complete.
As a logged on W3Schools user you will have access to many features like having your own web page, track your learning progress, receive personal guided paths, and more.
The Exercise
The exercises are a mix of "multiple choice" and "fill in the blanks" questions. There are between 3 and 9 questions in each category. The answer can be found in the corresponding tutorial chapter. If you're stuck, or answer wrong, you can try again or hit the "Show Answer" button to see the correct answer.
If you don't know C, we suggest that you read our C Tutorial from scratch.