Small & Simple Programs in C
Let's first start with very small & small programs to get basic idea of C programming code structure. We shall get the basic idea of variable declaration, scanning and printing etc.Basic Programs
We shall see the classic "Hello World!" program to get an insight of how a program is written in c. We have programs on variables available in c. These are most commonly used elementry variables. Also, we shall see how arithmatic operations can be performed in a c program.General Programs
There are programs which we use in our routine, or say a programmer's routine. These programs are easy to understand and should help in understanding style of C programming. We shall see here some of these programs and some cool tricks.- Compare two integers
- Compare three integers
- Find if a given number is even or odd
- Find if a given number is positive or negative
- Find if a year is leap year or not
- Swapping values using third variable
- Swapping values without using third variable
Loop Examples in C
This segment is designed to give the learner an enhanced view of how loops work in c langauges. We shall see simple loops like for, while and do-while, along with nested loops.Simple Loop Programs
Lets see some simple loop program we use in day-to-day life −- Simple Counting program in C
- Table of Counting program in C
- Table program in C
- Table of tables program in C
- Revere counting program in C
- Printing even values in a loop
- Printing odd values in a loop
Patterns Examples in C
This section is full of examples that uses nested loops in a controlled manner. We may see that the outer loop is controlling the inner one etc. We have taken the simplest examples which are very common too.- Equilateral triangle printing in C
- Right triangle printing in C
- Up-side down triangle printing in C
- Top down triangle printing in C
- Top down right triangle printing in C
- Floyd's triangle printing in C
- Pascal's triangle printing in C
Array Example Programs in C
Array is a collection of homogenous data, arranged in sequential format. Learning the concept of arrays in C is very important as it is the basic data structure. Here, in this section, we shall look into some very useful array programs to give you insight of how C programming language deals with arrays.Single Array Programs
These programs are basic and involves only a single array variable. We shall learn how to handle array variable in different situation.- Program to print an array
- Program to print an array in reverse order
- Program to calculate sum of an array
- Program to calculate average of an array
- Program to find the largest element of an array
- Program to find the second largest element of an array
- Program to find the smallest element of an array
Multi Array Programs
These programs involve more than one array. This section should give you some easy techniques to handle more than one array variables in a program.- Program to copy an array to another array
- Program to copy an array to another array in reverse
- Program to divide one array into two arrays
- Program to concatenate arrays
String Programs in C
Strings are actually one-dimensional array of characters terminated by a null character '\0'. Thus a null-terminated string contains the characters that comprise the string followed by a null.The following declaration and initialization create a string consisting of the word "Hello". To hold the null character at the end of the array, the size of the character array containing the string is one more than the number of characters in the word "Hello."
char greeting[6] = {'H', 'e', 'l', 'l', 'o', '\0'};If you follow the rule of array initialization then you can write the above statement as follows −
char greeting[] = "Hello";In this section, we shall learn how to work with string C programming language. We have divided the examples in multiple sub-sections to have a better understanding of what we are doing −
Basic Programs
These programs made specially to understand the basics of strings in C. These program deals with string as an array of characters.- Program to print a string in C
- Program to print a string character by character in C
- Program to find string length without function in C
- Program to count character occurrent in C
- Program to count vowels occurrent in C
- Program to sort string characters in C
Multi-string Programs
These programs has more than one string variables. These should give you an insight of how to work with multiple string variables in C programming language −- Program to copy string in C
- Program to reverse string in C
- Program to search strings in C
- Program to swap strings in C
- Program to compare two strings in C
- Program to concatenate two strings in C
- String Anagram program in in C
Long String Programs
A sentence or a line can be considered as a long string. The following programs deals with the same concept −Mathematical Programs in C
This section has been developed to introduce some common mathematical problems that can be solved using c programming language.Numbers & Series
Lets start with some designated number and series to program. Here we shall see how to program to get Armstrong, Prime, Factorial numbers and Fibonacci series.Average
Here we shall learn how to program to find average and percentages.Mean, Median & Mode
All three of mean, median and mode are types of different kind of averages. Mean deals with common way of finding average. Meadian is the centeral value of a list and mode is a value in a list which occurs the highest number of time.General Programs
Some basic and general programs learnt in schools can provide us an insight of programming techniques. Here we shall see few of the general programs used in school mathematics.Linked List Programs in C
A linked-list is a sequence of data structures which are connected together via links.Linked List is a sequence of links which contains items. Each link contains a connection to another link. Linked list the second most used data structure after array. Following are important terms to understand the concepts of Linked List.
- Link − Each Link of a linked list can store a data called an element.
- Next − Each Link of a linked list contain a link to next link called Next.
- LinkedList − A LinkedList contains the connection link to the first Link called First.
Simple (Singly) Linked List
This linked list has sequential one-way connection with adjacent nodes. It can only be parsed one-way. Here we shall learn the basic operation of singly list list.- Create Linked List
- Display Linked List in Reverse
- Find size of Linked List
- Search an Item in Linked List
- Update an Item in Linked List
- Remove an Item from Linked List
- Combine Two Linked List
- Split Linked List into two
Circular Linked List
Circular Linked List is a variation of Linked list in which first element points to last element and last element points to first element.- Create Linked List
- Display Linked List in Reverse
- Find size of Linked List
- Search an Item in Linked List
- Update an Item in Linked List
- Remove an Item from Linked List
- Combine Two Circular Linked List
- Split Linked List into two
No comments:
Post a Comment