C Algorithms Library

This article is about a collection of common Computer Science algorithms which may be used in C projects. The C Programming Language has a much smaller Standard Library as compared to other more modern programming languages such as Java or Python. The library provides a basic set of mathematical functions, string manipulation, type conversions, and file and console-based I/O.

The “Hello, World!” Program in C

This is a simple “Hello, World!” C program to display “Hello, World!” text on the computer screen or display device. Typically, the best way to learn programming is by writing code. The first program beginners write is “Hello, World!” which is often used...

C Implementation of Base64 Encoding and Decoding

Base64 encoding and decoding schemes are commonly used to encode binary data. Normally this is required when textual data needs to be transferred over the network or similar media and make sure that data is transferred without any modification. Base64 is commonly used in a number of applications, including email via MIME, and storing complex data in XML. This is a very simple implementation of base64 encoding and decoding in C programming language. There are number of C libraries available for encoding and decoding as well i.e. libb64, OpenSSL Base64, Apple’s Implementations, arduino-base64 etc.

Kruskal’s Algorithm Implementation in C

This is the implementation of Kruskal’s Algorithm in C Programming Language. This algorithm is directly based on the generic MST (Minimum Spanning Tree) algorithm. Kruskal’s algorithm is a greedy algorithm in graph theory that finds a minimum spanning tree for a connected weighted graph. It finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized.

Porter’s Algorithm in C

Originally written in 1979 at Computer Laboratory, Cambridge (England), it was reprinted in 1997 in the book “Readings in Information Retrieval”. Initially it was written in BCPL language. Here is the list of implementations in other programming languages including C, Java and Pearl implementations done by author himself.

Reading Files

This is a small C language program that can read a text file. The program is given file name as command parameter and it reads the file line by line. The program will prints out number of characters and words in each line. The program will also prints out the number...

C Program of Library Management System

This is a C program of Library Management System by which a librarian can operate a simple library. User can add multiple students, update their records and issue multiple books. This C Program shows different information about library including numbers of books and...

C Program to calculate Factorial of a Number

This C program calculates the the factorial of an integer number entered by the user. The function uses for loop to calculate the factorial and returns the number. Program terminates if a non integer number is entered. This C language program uses for loop in just a...

Snake Game – C Imlementation

This C program simulates the game “snake” which is usually available in old mobile phones. A string of characters moves on the screen according to arrow keys pressed by user. If it touches itself or screen boundary, the program terminates. When the snake moves, in arbitrary screen positions some digit (1-9) appears. The objective of the game is to make the snake eat the said digit, so that it is added to the score. When a digit is eaten, the size of the snake increases by the number of characters equal to the value of the digit.

Shuffle Game

Shuffle Game is a simple C program to shuffle the numbers. The numbers predefined from 1-8 and they can be sorted out first and then the numbers are easily shuffled to generate random sequence. It’s a very nice program for some one who have jsut started learning...