English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

C Language Basic Tutorial

C Language Flow Control

C Language Functions

C Language Arrays

C Language Pointers

C Language Strings

C Language Structure

C Language File

Other C

C Language Reference Manual

Comprehensive Collection of C Programming Examples

The best way to learn C programming is through practical exercises. This page contains some examples of basic concepts in C programming. It is recommended that you refer to the references in these examples and try to use them yourself. All the programs on this page have been tested and should run on all platforms.

    Basic Examples of C Language

  1. C "Hello, World!" Program

  2. C program to print an integer (input by the user)

  3. C program to add two integers       

  4. C program to multiply two floating-point numbers

  5. C program to find the ASCII value of a character

  6. C program for finding quotient and remainder

  7. C program to find the size of int, float, double, and char

  8. Demonstration of C program using the long keyword

  9. A C program to swap two numbers

  10. C Language flow control and loop instance

  11. A C program to check if a number is even or odd

  12. A C program to check if a character is a vowel or consonant

  13. A C program to find the largest number among three numbers

  14. A C program to find the roots of a quadratic equation

  15. A C program to check if a year is a leap year

  16. A C program to check if a number is positive or negative

  17. A C program to check if a character is a letter

  18. A C program to calculate the sum of natural numbers

  19. A C program to find the factorial of a number

  20. A C program to generate a multiplication table

  21. A C program to display the Fibonacci sequence

  22. A C program to find the GCD (greatest common divisor) of two numbers

  23. A C program to find the LCM of two numbers

  24. A C program uses a loop to display characters from A to Z

  25. A C program to calculate the number of digits in an integer

  26. A C program to reverse a number

  27. A C program to calculate the power of a number

  28. A C program to check if a number is palindrome

  29. A C program to check if a number is prime

  30. A C program to display prime numbers between two time intervals

  31. A C program to check Armstrong numbers

  32. A C program to display Armstrong numbers between two intervals

  33. A C program to display the factors of a number

  34. C Language function instance

  35. A C program uses switch ... case to make a simple calculator

  36. A C program to display prime numbers between intervals

  37. A C program, to check for prime numbers or Armstrong numbers using user-defined functions

  38. A C program to check if a number can be represented as the sum of two prime numbers

  39. A C program uses recursion to find the sum of natural numbers

  40. A C program uses recursion to find the factorial of a number

  41. A C program uses recursion to find GCD

  42. A C program to convert binary numbers to decimal

  43. A C program to convert octal numbers to decimal

  44. A C program to convert binary numbers to octal

  45. A C program uses recursion to reverse a sentence

  46. A C program uses recursion to calculate powers

  47. C Language pointer and array instance

  48. A C program to calculate the average using an array

  49. A C program to find the maximum element in an array

  50. A C program to calculate the standard deviation

  51. A C program uses multidimensional arrays to add two matrices

  52. A C program uses multidimensional arrays to multiply two matrices

  53. A C program to find the transpose of a matrix

  54. A C program to multiply two matrices by passing two matrices to the function

  55. A C program uses pointers to access array elements

  56. A C program uses reference calling to arrange numbers in a circular order

  57. A C program uses dynamic memory allocation to find the maximum number

  58. C Language string instance

  59. A C program to find the frequency of characters in a string

  60. A C program to calculate the number of vowels, consonants, etc.

  61. A C program to delete all characters except letters in a string

  62. A C program to find the length of a string

  63. A C program to concatenate two strings

  64. A C program to copy a string without using strcpy()

  65. A C program sorts elements in dictionary order (dictionary order)

  66. C Language structure instance

  67. A C program to store student information

  68. A C program uses 'structure' to add two distances (in inches)-in feet units)

  69. A C program to add two complex numbers by passing structure to the function

  70. C Program to Calculate the Time Difference Between Two Time Periods

  71. C Program Using Structures to Store Student Information

  72. C Program, Used to Dynamically Store Data in Structures

  73. C Language File (I/O) Example

  74. C Program to Write Sentences to a File

  75. C Program to Read a Line from a File and Display It

  76. C Program to Display Its Own Source Code as Output

  77. C Program to Print Pyramid and Patterns