C Programs Last Updated : 10 Jan, 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 Next Article C Programs abhishek1 Follow Improve Article Tags : C Programs C Language Similar Reads C File Handling Programs C Program to list all files and sub-directories in a directory C Program to count number of lines in a file C Program to print contents of file C Program to copy contents of one file to another file C Program to merge contents of two files into a third file C program to delete a file 1 min read Commonly Asked C Programming Interview Questions | Set 3 Q.1 Write down the smallest executable code? Ans. main is necessary for executing the code. Code is C void main() { } Output Q.2 What are entry control and exit control loops? Ans. C support only 2 loops: Entry Control: This loop is categorized in 2 part a. while loop b. for loopExit control: In thi 5 min read Output of C programs | Set 66 (Accessing Memory Locations) Q1. Is the output of this code True or False? C #include <stdio.h> int main(void) { int b = 20; int* y = &b; char n = 'A'; char* z = &n; y[0] = z[0]; printf((*y == *z) ? "True" : "False"); } A. True B. False C. Program would crash D. Compilation error Answer: A. Tru 7 min read C Multiple Choice Questions C is the most popular programming language developed by Dennis Ritchie at the Bell Laboratories in 1972 to develop the UNIX operating systems. It is a general-purpose and procedural programming language. It is faster than the languages like Java and Python. C is very versatile it can be used in both 4 min read C Exercises - Practice Questions with Solutions for C Programming The best way to learn C programming language is by hands-on practice. This C Exercise page contains the top 30 C exercise questions with solutions that are designed for both beginners and advanced programmers. It covers all major concepts like arrays, pointers, for-loop, and many more.So, Keep it Up 12 min read C program to Find the Largest Number Among Three Numbers Given 3 integer numbers, the task is to find the largest number among them.ExamplesInput: a = 10, b = 22, c = 19Output: 22 is the largest number.Explanation: Among the numbers 5, 8, and 3, the largest number is 8.Input: a = 12, b = 7, c = 9Output: 12 is the largest number.Explanation: Among the numb 4 min read Getting started with C C language is a popular programming language that was developed in 1970 by Dennis Ritchie at Bell Labs. The C programming language was developed primarily to build the UNIX operating system. It is widely used because it is simple, powerful, efficient, and portable. Features of C Programming Language 5 min read LMNs-C Programming C programming is a powerful and widely-used programming language that forms the backbone of many modern technologies. Known for its simplicity and efficiency, it is the foundation for learning advanced programming concepts. C programming is a powerful and widely-used programming language that forms 6 min read Output of C Program | Set 19 Predict the outputs of following program. Difficulty Level: Rookie Question 1 C #include <stdio.h> int main() { int a = 10, b = 20, c = 30; if (c > b > a) { printf("TRUE"); } else { printf("FALSE"); } getchar(); return 0; } Output: FALSE Let us consider the condition 1 min read Output of C Program | Set 20 Predict the outputs of following C programs. Question 1 C int main() { int x = 10; static int y = x; if(x == y) printf("Equal"); else if(x > y) printf("Greater"); else printf("Less"); getchar(); return 0; } Output: Compiler Error In C, static variables can only be in 2 min read Like