C program to implement Russian Peasant
Here is a C program that I wrote years back to implement Russian Peasant method of an interesting multiplication technique – main(){ int a, b,...
C program to find numbers whose sum of cubes of individual numbers is that number
Here is an implementation of while loop in C to find numbers whose sum of cubes of individual numbers is that number. You can go...
C program to find circumference and area of a circle from given radius
Here is a simple C program to find circumference and area of a circle from given radius – main(){ float r, pi = 3.1416, c, area;...
While Loop in C
Like do-while loop, While loop is the most commonly used looping construct to repeat a process or calculation for a set or collection of inputs...
C program to find the sum of squares of first n natural numbers
Here is a simple C program to find the sum of squares of first n natural numbers using do-while looping construct – main(){ int n,...
Do – While Loops in C
Looping constructs is an important programming language technique to repeat a process or calculation for a set or collection of inputs or storage based on...
Sample C program showing if – else constructs
Below are simple C programs for beginners to learn if-else decision construct. Example 1: Program to check if a number is odd or even main...
C Program to check for leap year
Here is a C program to check for leap year – main () { int year; printf("Please enter any year as 4 digits>> "); scanf("%d",...
Making decision in C program
Decision making is an important aspect of programming language that enables the programmer to arrive at a conclusion based on certain data processing, comparisons and conditional...
Declaring variables in C language
C programming language allows to define and classify data so we can use it appropriately in various parts of the program in the correct form...
C Programming Language
C language developed at Bell lab by Dennis Ritchie on UNIX environment. UNIX was later rewritten in C. An earlier version of C is BCPL...
Recursive C program for Binary search
Below is an example Recursive C program to perform Binary – int binsearch(int low, int high, in a, X){ int mid; if(low > high){ return(-1);...
Recursive C program to print Fibonacci series
Below is an example recursive C program to return Fibonacci series for a given number – int fibonacci (int x){ if(n < 0){ printf("Invalid input");...
C program for finding factorial by recursion
Here is a C program to find a factorial by recursive method – int factorial (int x ) { return ( n==0? 1: n*(fact(n-1))); }...
Bubble sort in C
Simple bubble sort in C – for (i=0; i<n-1; i++){ for(j=i+1; j<n; j++){ if(x[j] < x[i]){ temp = x[j]; x[j] = x[i]; x[i] = temp;...
Tree representation in C
Below is an example to represent a Tree structure in C using struct...
File Operation in C
Below is a simple C program to perform file operation – include <stdlib.h> main() { FILE * file_source char * file_name = (char*) malloc (sizeof...
C program to evaluate the 1st derivative of a function at any given point
Writing C programs for numerical differentiation is interesting and fun. Here is one that I wrote years back. Enjoy! ...
Gregory Newton Backward Interpolation Method
Gregory Newton Backward Interpolation Method can be used to derive difference formula when the x values are at equidistant intervals and the value to be...
C Program to evaluate forward difference
Below is a C program to evaluate forward difference and thus print a forward difference table for n function values –...
Reducing Lagranges interpolation formula to Linear interpolation
Below is an amazing solution to prove that when n=2, Lagranges interpolation formula reduces to Linear interpolation –...
Mobile Communication Services
One of the fastest growth rates in the telecommunications industry anywhere in the world is that of mobile radio communication devices. The basic architecture of...
Digitized Phone Services (E-10B)
Olden form of phone systems involved manual exchanges which involved a great task in switching and routing of calls to various subscribers that increased network...
Early Evolution of Data Commmunication Systems
It’s helpful for data communication and IT students to understand the evolution of Data communication systems. The first phase in the evolution of data communication...
Data Communication and its basic setup
Data Communications is the function of transferring a digital signal from one digital device to another. Data transmission and data communications mean two different things....
C program to convert a postfix string to prefix form
Below is sample C program to convert a postfix string to prefix form. Also included is detailed flow chart of the program and dry run...
C program to convert a prefix string to infix form
Below is sample C program to convert a prefix string to infix form. Also included is detailed flow chart of the program and dry run...
Representing a Linked List as a Binary Tree
...
Example for Preorder and Postorder traversal of a Binary tree
Below is an example that I prepared for preorder and postorder traversal of a Binary Tree – enjoy!...
Traversing a Binary Tree in Postorder
Below is the algorithm and C routine for traversing a Binary Tree in postorder. ...
Traversing a Binary Tree in Preorder
A binary tree can be traversed in two basic ways – preorder and postorder. Explained below is the process or preorder traverse of a binary...
Binary Tree
Binary Tree is a basic data structure that is used behind the scenes of all major technologies whether it’s a Database system or operating system,...