C Functions
C structures, c exercises.
You can test your C skills with W3Schools' Exercises.
We have gathered a variety of C exercises (with answers) for each C Chapter.
Try to solve an exercise by editing some code, or show the answer to see what you've done wrong.
Count Your Score
You will get 1 point for each correct answer. Your score and total score will always be displayed.
Start C Exercises
Start C Exercises ❯
If you don't know C, we suggest that you read our C Tutorial from scratch.
COLOR PICKER
Report Error
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
Top Tutorials
Top references, top examples, get certified.
Basic programming exercises and solutions in C
C programming is a stepping stone for many programmers in the programming world. C is best to learn internals of programming and know how a computer program works internally.
Since it is close to low level programming. Programming in C can be a nightmare for beginners if not practiced properly. However, you can learn and practice at Codeforwin step by step.
In this programming exercise we will focus on basics of C programming. After completing this exercise you will learn basic structure and semantics of a C program and how to write mathematical programs in C.
If you are not a beginner, still reached here. Hold your breath I am sure you will find these exercises interesting.
Always feel free to drop your questions in comments section . I love to hear hugs and bugs from you all.
Required knowledge
Operators , Data types , Variables and expression , Basic input/output
List of basic programming exercises
- Write a C program to perform input/output of all basic data types .
- Write a C program to enter two numbers and find their sum.
- Write a C program to enter two numbers and perform all arithmetic operations.
- Write a C program to enter length and breadth of a rectangle and find its perimeter.
- Write a C program to enter length and breadth of a rectangle and find its area.
- Write a C program to enter radius of a circle and find its diameter, circumference and area.
- Write a C program to enter length in centimeter and convert it into meter and kilometer.
- Write a C program to enter temperature in Celsius and convert it into Fahrenheit.
- Write a C program to enter temperature in Fahrenheit and convert to Celsius
- Write a C program to convert days into years, weeks and days .
- Write a C program to find power of any number x ^ y.
- Write a C program to enter any number and calculate its square root.
- Write a C program to enter two angles of a triangle and find the third angle.
- Write a C program to enter base and height of a triangle and find its area.
- Write a C program to calculate area of an equilateral triangle.
- Write a C program to enter marks of five subjects and calculate total, average and percentage.
- Write a C program to enter P, T, R and calculate Simple Interest.
- Write a C program to enter P, T, R and calculate Compound Interest.
IMAGES
VIDEO
COMMENTS
We have gathered a variety of C exercises (with answers) for each C Chapter. Try to solve an exercise by editing some code, or show the answer to see what you've done wrong. Count Your Score. You will get 1 point for each correct answer. Your score and total score will always be displayed.
Code practice and mentorship for everyone. Develop fluency in 69 programming languages with our unique blend of learning, practice and mentoring. Exercism is fun, effective and 100% free, forever. Get fluent in C by solving 79 exercises. And then level up with mentoring from our world-class team.