Basic programming exercises and solutions in C

This programming exercise is fully intended for the beginners who have just started to code. After completing this you would be familiar with the programming structures and semantics in C and will also increase your logical thinking ability. If you are not a beginner you can try some other exercises.

Required knowledge:

Fundamentals of C, Data types, Taking user input in C

Here is a set of basic programming exercises to practice for beginners.
  1. Write a C program to enter two numbers and find their sum.
  2. Write a C program to enter two numbers and perform all arithmetic operations.
  3. Write a C program to enter length and breadth of a rectangle and find its perimeter.
  4. Write a C program to enter length and breadth of a rectangle and find its area.
  5. Write a C program to enter radius of a circle and find its diameter, circumference and area.
  6. Write a C program to enter length in centimeter and convert it into meter and kilometer.
  7. Write a C program to enter temperature in °Celsius and convert it into °Fahrenheit.
  8. Write a C program to enter temperature in Fahrenheit(°F) and convert it into Celsius(°C)
  9. Write a C program to convert days into years, weeks and days.
  10. Write a C program to find power of any number xy (x^y).
  11. Write a C program to enter any number and calculate its square root.
  12. Write a C program to enter two angles of a triangle and find the third angle.
  13. Write a C program to enter base and height of a triangle and find its area.
  14. Write a C program to calculate area of an equilateral triangle.
  15. Write a C program to enter marks of five subjects and calculate total, average and percentage.
  16. Write a C program to enter P, T, R and calculate Simple Interest.
  17. Write a C program to enter P, T, R and calculate Compound Interest.


Any doubt or suggestion write here. I will try my best to help. Before posting your code you must escape it to view. To format your source code and use format highlighting, post your source code inside
< code >< pre > -- Your source code -- < /pre >< /code > (Remove spaces from pre and code tags).

5 comments:

  1. Thanks for sharing those useful basic programming links, it helps me to explore my knowledge in programming...if you want to switch your career in developing area you should know the basic of programmings for that you have to read python because it was the first programming language for more details contact the link.
    Regards,
    Python Training in Chennai|Python Training

    ReplyDelete
  2. very useful for the beginners like me

    ReplyDelete
    Replies
    1. I am really glad to know if it was helpful to you. Just creating things that can be useful to other.

      Delete
  3. keep updating us with new programs

    ReplyDelete
    Replies
    1. Surely you will see new programs. Apart from that if you have any program in your mind or elsewhere you can also contact for updating with the same.

      Delete