Beginner C Programming Exercises

 SEQUENCE STRUCTURE (straight line paths)
  1. Program to print “Hello, World!” [Code]
  2. Program to print a capital F in hash characters [Code]
  3. Program to print a capital C in hash characters [Code]
  4. Program to input a single character using the getchar() function [Code]
  5. Program to output a single character using the putchar() function [Code]
  6. Program to read a whole word using the scanf() function [Code]
  7. Program to read numeric input [Code]
  8. Program to generate a random number [Code]
  9. Program to calculate ASCII value [Code]
  10. Program swap two numbers using temporary third variable [Code]
  11. Program to convert temperature from Celsius to Fahrenheit [Code]
  12. Program to add two numbers together [Code]
  13. Program to Compute Quotient and Remainder [Code]
  14. Program to convert distance in km to cm, feet, inch and meter [Code]
  15. Program that prints forename, surname and year of birth [Code]
  16. Program that calculates the total number of minutes with hour and minutes [Code]
  17. Program that takes hours and minutes as input, and calculates the total number of hours and minutes [Code]
  18. Program to convert specified days into years, weeks and days (ignoring leap year) [Code]
SELECTION STRUCTURE (one or many branches)
  1. Program to accept two integers and check whether they are equal or not [Code]
  2. Program to check whether a given number is positive or negative [Code]
  3. Program to find the largest number among three numbers [ Code]
  4. Program to check whether a number is even or odd [Code]
  5. Program to check if a number is prime or not [Code]
  6. Program to read temperature in centigrade and display a suitable message [Code]
  7. Program to check whether a triangle is Equilateral, Isosceles or Scalene [Code]
  8. Program to check whether a triangle can be formed by the given value for the angles [Code]
single LOOP STRUCTURE (repetition of a set of activities)
  1. Program that counts using a while loop [Code]
  2. Program to find whether a given year is a leap year or not [Code ]
  3. Program to display table of ASCII values [Code]
  4. Program to display upper-case alphabet using ASCII values [Code]
  5. Program to display lower-case alphabet using ASCII values [Code]
  6. Program to calculate sum of user defined numbers without using array [Code]
  7. Program to generate multiplication table up to a user-defined range using for loop [Code]
  8. Program to reverse an integer [Code]
  9. Program to display user-defined terms of odd natural number and their sum [Code]
  10. Program to display square pattern [Code]
  11. Program to display rectangle pattern [Code]
  12. Program to display half pyramid pattern [Code]
  13. Program to display mirrored half pyramid pattern [Code]
Nested loop structure (The placing of one loop inside the body of another loop)
  • I need to organize this section in the future from the previous section