🎉 Exercism Research is now launched. Help Exercism, help science and have some fun at
research.exercism.io
🎉
Sign up
Log in
Home
Language tracks
C track
Exercises
Exercises on the C track
Join the C Track
71 exercises to help you master C
easy
Hello World
The classical introductory exercise. Just say "Hello, World!"
strings
easy
Armstrong Numbers
Determine if a number is an Armstrong number
control flow if else statements
control flow loops
math
logic
easy
Darts
Write a function that returns the earned points in a single toss of a Darts game
control flow if else statements
math
logic
easy
Resistor Color
Convert a resistor band's color to its numeric representation
enums
arrays
pointers
easy
Resistor Color Duo
Convert color codes, as used on resistors, to a numeric value.
enums
arrays
easy
Resistor Color Trio
Convert color codes, as used on resistors, to a human-readable label.
enums
arrays
structs
easy
Isogram
Determine if a word or phrase is an isogram.
arrays
control flow if else statements
control flow loops
strings
easy
Acronym
Convert a long phrase to its acronym
control flow loops
memory management
strings
easy
Word Count
Given a phrase, count the occurrences of each word in that phrase.
filtering
memory management
strings
structs
easy
Pangram
Determine if a sentence is a pangram.
control flow if else statements
control flow loops
strings
easy
Gigasecond
Given a moment, determine the moment that would be after a gigasecond has passed.
dates
easy
Space Age
Given an age in seconds, calculate how old someone is in terms of a given planet's solar years.
functions
medium
Meetup
Calculate the date of meetups.
control flow if statements
preprocessor x macros in test
strings
structs
time functions
easy
Hamming
Calculate the Hamming difference between two DNA strands.
arrays
control flow loops
strings
easy
RNA Transcription
Given a DNA strand, return its RNA Complement Transcription.
control flow case statements
control flow loops
strings
easy
Nucleotide Count
Given a DNA string, compute how many times each nucleotide occurs in the string.
control flow loops switch if statements
memory management
strings
text formatting
easy
Grains
Calculate the number of grains of wheat on a chessboard given that the number on each square doubles.
bitwise operations
control flow loops
performance optimizations
easy
Leap
Given a year, report if it is a leap year.
control flow if else statements
logic
easy
Beer Song
Produce the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall.
control flow if else statements
control flow loops
strings
easy
Raindrops
Convert a number to a string, the content of which depends on the number's factors.
control flow if else statements
strings
medium
Bob
Bob is a lackadaisical teenager. In conversation, his responses are very limited.
control flow if else statements
strings
easy
Difference Of Squares
Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.
control flow loops
math
medium
Sum Of Multiples
Given a number, find the sum of all the multiples of particular numbers up to but not including that number.
control flow case statements
control flow loops
math
medium
Square Root
Given a natural radicand, return its square root.
control flow loops
bitwise operations
math
easy
Grade School
Given students' names along with the grade that they are in, create a roster for the school
control flow if else statements
control flow loops
arrays
pointers
structs
sorting
strings
easy
Binary Search
Implement a binary search algorithm.
arrays
control flow if else statements
control flow loops
searching
medium
Anagram
Given a word and a list of possible anagrams, select the correct sublist.
filtering
strings
structs
medium
Rational Numbers
Implement rational numbers.
math
structs
easy
Roman Numerals
Write a function to convert from normal numbers to Roman Numerals.
arrays
control flow loops
memory management
strings
structs
easy
Circular Buffer
A data structure that uses a single, fixed-size buffer as if it were connected end-to-end.
control flow if else statements
control flow loops
memory management
arrays
pointers
structs
flexible array members
buffers
easy
List Ops
Implement basic list operations
control flow if else statements
control flow loops
memory management
arrays
pointers
function pointers
structs
flexible array members
medium
Pythagorean Triplet
There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product a * b * c.
control flow if else statements
control flow loops
memory management
arrays
flexible array members
structs
medium
Saddle Points
Detect saddle points in a matrix.
control flow if else statements
control flow loops
memory management
arrays
flexible array members
structs
medium
Allergies
Given a person's allergy score, determine whether or not they're allergic to a given item, and their full list of allergies.
control flow if statements
control flow loops
memory management
structs
medium
Atbash Cipher
Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.
control flow if else statements
control flow loops
strings
easy
Series
Given a string of digits, output all the contiguous substrings of length `n` in that string.
control flow if statements
memory management
strings
text formatting
hard
React
Implement a basic reactive system.
functions
memory management
medium
Phone Number
Clean up user-entered phone numbers so that they can be sent SMS messages.
control flow if else statements
control flow loops
memory management
strings
easy
Clock
Implement a clock that handles times without dates.
control flow if statements
preprocessor x macros in test
strings
text formatting
easy
Sieve
Use the Sieve of Eratosthenes to find all the primes from 2 up to a given number.
control flow if statements
memory management
math
medium
Nth Prime
Given a number n, determine what the nth prime is.
control flow if else statements
control flow loops
performance optimizations
math
easy
Robot Simulator
Write a robot simulator.
control flow if statements
pointers
strings
structs
variable argument lists
easy
Pascal's Triangle
Compute Pascal's triangle up to a given number of rows.
control flow if else statements
memory management
math
easy
Triangle
Determine if a triangle is equilateral, isosceles, or scalene.
booleans
control flow if else statements
structs
easy
Perfect Numbers
Determine if a number is perfect, abundant, or deficient based on Nicomachus' (60 - 120 CE) classification scheme for positive integers.
control flow if else statements
math
easy
Collatz Conjecture
Calculate the number of steps to reach 1 using the Collatz conjecture
functions
math
easy
Binary
Convert a binary number, represented as a string (e.g. '101010'), to its decimal equivalent using first principles
control flow if statements
control flow loops
math
easy
All Your Base
Convert a number, represented as a sequence of digits in one base, to any other base.
arrays
control flow if else statements
control flow loops
math
easy
Palindrome Products
Detect palindrome products in a given range.
functions
pointers
strings
structs
math
medium
Sublist
Write a function to determine if a list is a sublist of another list.
arrays
control flow if statements
control flow loops
pointers
searching
medium
Largest Series Product
Given a string of digits, calculate the largest product for a contiguous substring of digits of length n.
control flow loops
performance optimizations
strings
math
medium
Scrabble Score
Given a word, compute the Scrabble score for that word.
pointers
searching
strings
structs
easy
Queen Attack
Given the position of two queens on a chess board, indicate whether or not they are positioned so that they can attack each other.
control flow if statements
enums
functions
structs
medium
Linked List
Implement a doubly linked list
functions
structs
pointers
lists
easy
Complex Numbers
Implement complex numbers.
performance optimizations
structs
math
easy
ETL
We are going to do the `Transform` step of an Extract-Transform-Load.
pointers
structs
easy
Prime Factors
Compute the prime factors of a given natural number.
algorithms
math
easy
Luhn
Given a number determine whether or not it is valid per the Luhn formula.
algorithms
strings
medium
Matching Brackets
Make sure the brackets and braces all match.
control flow if statements
recursion
stacks
medium
Say
Given a number from 0 to 999,999,999,999, spell out that number in English.
algorithms
control flow if statements
strings
medium
Crypto Square
Implement the classic method for composing secret messages called a square code.
algorithms
control flow if statements
strings
easy
Secret Handshake
Given a decimal number, convert it to the appropriate sequence of events for a secret handshake.
algorithms
control flow if statements
strings
medium
Pig Latin
Implement a program that translates from English to Pig Latin
algorithms
control flow if statements
functions
strings
easy
Minesweeper
Add the numbers to a minesweeper board
arrays
control flow if statements
strings
medium
Run Length Encoding
Implement run-length encoding and decoding.
algorithms
control flow if statements
strings
easy
Two Fer
Create a sentence of the form "One for X, one for me."
control flow if statements
strings
medium
Wordy
Parse and evaluate simple math word problems returning the answer as an integer.
algorithms
control flow if statements
functions
strings
medium
Binary Search Tree
Insert and search for numbers in a binary tree.
arrays
control flow loops
recursion
structs
easy
Diamond
Given a letter, print a diamond starting with 'A' with the supplied letter at the widest point.
arrays
control flow if statements
functions
strings
medium
Rail Fence Cipher
Implement encoding and decoding for the rail fence cipher.
arrays
control flow if statements
strings
medium
Two Bucket
Given two buckets of different size, demonstrate how to measure an exact number of liters.
algorithms
control flow if else statements
control flow loops