C Programs Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report To learn anything effectively, practicing and solving problems is essential. To help you master C programming, we have compiled over 100 C programming examples across various categories, including basic C programs, Fibonacci series, strings, arrays, base conversions, pattern printing, pointers, and more. These C Examples cover a range of questions, from fundamental concepts to advanced topics, and are frequently asked in C-based programming interviews.C Program Topics:Basic C ProgramControl Flow Pattern PrintingFunctionsArraysStringsConversionsPointersStructures and UnionsFile IODate and TimeMore C ProgramsPrerequisite: Before you start with these C programs, take a look at our C tutorial to get a good understanding of the basics. Bascally, C programming is a versatile language that powers many foundational systems. C Program - BasicC Hello World ProgramC Program to Print Your Own Name C Program to Print an Integer Entered By the UserC Program to Add Two NumbersC Program to Check Whether a Number is Prime or NotC Program to Multiply two Floating-Point Numbers C Program to Print the ASCII Value of a CharacterC Program to Swap Two NumbersC Program to Calculate Fahrenheit to CelsiusC Program to Find the Size of int, float, double, and charC Program to Add Two Complex Numbers C Program to Print Prime Numbers From 1 to N C Program to Find Simple InterestC Program to Find Compound InterestC Program for Area And Perimeter Of Rectangle C Program - Control FlowC Program to Check Whether a Number is Positive, Negative, or ZeroC Program to Check Whether Number is Even or OddC Program to Check Whether a Character is Vowel or Consonant C Program to Find Largest Number Among Three NumbersC Program to Calculate Sum of Natural Numbers C Program to Print Alphabets From A to Z Using LoopC Program to Check Leap YearC Program to Find Factorial of a NumberC Program to Make a Simple Calculator C Program to Generate Multiplication Table C Program to Print Fibonacci SeriesC Program to Find LCM of Two NumbersC Program to Check Armstrong NumberC Program to Display Armstrong Numbers Between 1 to 1000 C Program to Display Armstrong Number Between Two Intervals C Program to Reverse a NumberC Program to Check Whether a Number is a Palindrome or Not C Program to Check Whether a Number is Prime or NotC Program to Display Prime Numbers Between IntervalsC Program to Check whether the input number is a Neon NumberC Program to Find All Factors of a Natural NumberC program to Sum of Fibonacci Numbers at Even Indexes up to N Terms C Program - Pattern PrintingC Program to Print Simple Pyramid Pattern C Program to Print Given Triangle C Program to Print 1800 Rotation of Simple PyramidC Program to Print Inverted Pyramid C Program to Print Number PatternC Program to Print Character Pattern C Program to Print Continuous Character PatternC Program to Print Hollow Star PyramidC Program to Print Inverted Hollow Star pyramid C Program to Print Hollow Star Pyramid in a Diamond ShapeC Program to Print Full Diamond Shape PyramidC Program to Print Pascal's Pattern Triangle Pyramid C Program to Print Floyd's Pattern Triangle Pyramid C Program to Print Reverse Floyd pattern Triangle Pyramid C Program - FunctionsC Program to Check Prime Number By Creating a Function C Program to Display Prime Numbers Between Two Intervals Using Functions C Program to Find All Roots of a Quadratic EquationC Program to Check Whether a Number can be Express as Sum of Two Prime NumbersC Program to Find the Sum of Natural Numbers using Recursion C Program to Calculate the Factorial of a Number Using Recursion C Program to Find G.C.D Using RecursionC Program to Reverse a Stack using RecursionC Program to Calculate Power Using RecursionC Program - ArraysC Program to Print a 2D ArrayC Program to Find the Largest Element in an ArrayC Program to Find the Maximum and Minimum in an ArrayC Program to Search an Element in an Array (Binary search)C Program to Calculate the Average of All the Elements Present in an Array C Program to Sort an Array using Bubble SortC Program to Sort an Array using Merge SortC Program to Sort an Array Using Selection Sort C Program to Sort an Array Using Insertion SortC Program to Sort the Elements of an Array in Descending OrderC Program to Sort the Elements of an Array in Ascending Order C Program to Remove Duplicate Elements From a Sorted ArrayC Program to Merge Two Arrays C Program to Remove All Occurrences of an Element in an Array C Program to Find Common Array Elements C Program to Copy All the Elements of One Array to Another ArrayC Program For Array Rotation C Program to Sort the 2D Array Across RowsC Program to Check Whether Two Matrices Are Equal or Not C Program to Find the TransposeC Program to Find the Determinant of a Matrix C Program to Find the Normal and Trace C Program to Add Two MatricesC Program to Multiply Two MatricesC Program to Print Boundary Elements of a Matrix C Program to Rotate Matrix Elements C Program to Compute the Sum of Diagonals of a Matrix C Program to Interchange Elements of First and Last in a Matrix Across Rows C Program to Interchange Elements of First and Last in a Matrix Across Columns C Program - StringsC Program to Add or Concatenate Two StringsC Program to Add 2 Binary StringsC Program to Get a Non-Repeating Character From the Given StringC Program to check if the string is palindrome or notC Program to Reverse an Array or StringC program to Reverse a String Using RecursionC Program to Find the Length of a StringC Program to Sort a StringC Program to Check For Pangram StringC Program to Print the First Letter of Each Word C Program to Determine the Unicode Code Point at a Given Index C Program to Remove Leading Zeros C Program to Compare Two StringsC Program to Compare Two Strings Lexicographically C Program to Insert a String into Another StringC Program to Split a String into a Number of Sub-Strings C Program - ConversionsC Program For Boolean to String Conversion C Program For Float to String ConversionC Program For Double to String Conversion C Program For String to Long ConversionC Program For Long to String ConversionC Program For Int to Char Conversion C Program For Char to Int Conversion C Program For Octal to Decimal Conversion C Program For Decimal to Octal ConversionC Program For Hexadecimal to Decimal Conversion C Program For Decimal to Hexadecimal Conversion C Program For Decimal to Binary Conversion C Program For Binary to Decimal ConversionC Program - PointersHow to Return a Pointer from a Function in CHow to Declare a Two-Dimensional Array of Pointers in C?C Program to Find the Largest Element in an Array using PointersC Program to Swap Two NumbersC Program to Sort an Array using PointersC Program to Sort a 2D Array of StringsC Program to Check if a String is a Palindrome using PointersC Program to Create a Copy of a Singly Linked List using RecursionC Program - Structures and UnionsC Program to Store Information of Students Using StructureC Program to Store Student Records as Structures and Sort them by NameC Program to Add N Distances Given in inch-feet System using StructuresC Program to Add Two Complex Numbers by Passing Structure to a FunctionC Program to Store Student Records as Structures and Sort them by Age or IDRead/Write Structure to a File in C Flexible Array Members in a Structure in CC Program - File IOC Program to Create a Temporary FileC Program to Read/Write Structure to a FileC Program to Rename a fileC Program to Make a File Read-OnlyC program to Compare Two Files and Report MismatchesC Program to Copy One File into Another File C Program to Print all the Patterns that Match Given Pattern From a FileC Program to Append the Content of One Text File to AnotherC Program to Read Content From One File and Write it Into Another FileC Program to Read and Print all Files From a Zip File C Program - Date and TimeC Program to Format time in AM-PM format C program to Print Digital Clock with the Current TimeC Program to Display Dates of Calendar Year in Different FormatsC Program to Display Current Date and TimeC Program to Maximize Time by Replacing ‘_’ in a Given 24-Hour Format TimeC Program to Convert the Local Time to GMTC Program to Convert Hours into Minutes and SecondsC Program - More C ProgramsC Program to Show Runtime exceptions C Program to Show Types of errors C Program to Show Unreachable Code Error C Program to Find Quotient and Remainder C Program to Find the Initials of a Name C Program to Draw a Circle in GraphicsPrinting Source Code of a C Program Itself Comment More infoAdvertise with us A abhishek1 Follow Improve Article Tags : C Programs C Language Explore C Programming Language Tutorial 4 min read C BasicsC Language Introduction 6 min read Features of C Programming Language 3 min read C Programming Language Standard 6 min read C Hello World Program 1 min read Compiling a C Program: Behind the Scenes 4 min read C Comments 3 min read Tokens in C 4 min read Keywords in C 2 min read C Variables and ConstantsC Variables 4 min read Constants in C 4 min read Const Qualifier in C 6 min read Different ways to declare variable as constant in C 2 min read Scope rules in C 5 min read Internal Linkage and External Linkage in C 4 min read Global Variables in C 3 min read C Data TypesData Types in C 5 min read Literals in C 4 min read Escape Sequence in C 5 min read bool in C 5 min read Integer Promotions in C 2 min read Character Arithmetic in C 2 min read Type Conversion in C 4 min read C Input/OutputBasic Input and Output in C 4 min read Format Specifiers in C 5 min read printf in C 5 min read scanf in C 3 min read Scansets in C 2 min read Formatted and Unformatted Input/Output in C 6 min read C OperatorsOperators in C 11 min read Arithmetic Operators in C 5 min read Unary Operators in C 5 min read Relational Operators in C 4 min read Bitwise Operators in C 6 min read C Logical Operators 4 min read Assignment Operators in C 4 min read Increment and Decrement Operators in C 4 min read Conditional or Ternary Operator (?:) in C 3 min read sizeof operator in C 3 min read Operator Precedence and Associativity in C 7 min read C Control Statements Decision-MakingDecision Making in C (if , if..else, Nested if, if-else-if ) 7 min read C - if Statement 4 min read C if else Statement 3 min read C if , else if ladder 4 min read Switch Statement in C 5 min read Using Range in switch Case in C 2 min read C - Loops 6 min read C for Loop 4 min read while Loop in C 5 min read do...while Loop in C 4 min read For vs. While 4 min read Continue Statement in C 4 min read Break Statement in C 5 min read goto Statement in C 4 min read C FunctionsC Functions 6 min read User-Defined Function in C 6 min read Parameter Passing Techniques in C 3 min read Function Prototype in C 4 min read How can I return multiple values from a function? 3 min read main Function in C 5 min read Implicit Return Type int in C 2 min read Callbacks in C 4 min read Nested Functions in C 4 min read Variadic Functions in C 5 min read _Noreturn function specifier in C 2 min read Predefined Identifier __func__ in C 2 min read C Library math.h Functions 6 min read C Arrays & StringsC Arrays 7 min read Properties of Array in C 7 min read Multidimensional Arrays in C - 2D and 3D Arrays 8 min read Initialization of Multidimensional Array in C 4 min read Pass Array to Functions in C 3 min read How to pass a 2D array as a parameter in C? 3 min read What are the data types for which it is not possible to create an array? 2 min read How to pass an array by value in C ? 2 min read Strings in C 6 min read Array of Strings in C 3 min read What is the difference between single quoted and double quoted declaration of char array? 2 min read C String Functions 6 min read C PointersC Pointers 9 min read Pointer Arithmetics in C with Examples 10 min read C - Pointer to Pointer (Double Pointer) 5 min read Function Pointer in C 6 min read How to Declare a Pointer to a Function? 2 min read Pointer to an Array | Array Pointer 5 min read Difference between constant pointer, pointers to constant, and constant pointers to constants 3 min read Pointer vs Array in C 1 min read Dangling, Void , Null and Wild Pointers in C 6 min read Near, Far and Huge Pointers in C 4 min read restrict Keyword in C 3 min read Like