Category: Source Code

LRU and FIFO L1 Cache Implementation using C

This is a C program to demonstrate cache mechanism by simulating a cache in C. The source code can run in any C Compiler with minor modifications if required. It can run on real memory traces as input to your cache simulator. We have implemented two cache replacement policies i.e. least recently used (LRU) and First-in first-out (FIFO) replacement policies.

Read More

Vigenere Encryption and Decryption in C++

The Vigenere cipher is a method of encrypting or decrypting alphabetic text by using a series of interwoven Caesar ciphers (Caesar Shift), based on the letters of a keyword. In cryptography, Caesar shift is one of the simplest known encryption techniques. It employs a form of polyalphabetic substitution, which is using multiple substitution alphabets.

Read More

C++ Program to solve the Quadratic Equation

This program will solve quadratic equations. It accepts coefficients of a quadratic equation from the user i.e. a, b and c and displays the roots. To compile the program name it quadratic_solver.cpp then type g++ -o quadratic_solver quadratic_solver.cpp You may need to use math.h like this: #include if you are using windows C++ programming software. (I tried it without the math.h and got an “undeclared identifier” error)

Read More

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.

Read More

C++ “Hello World” Program

Typically, the best way to learn programming is by writing code. The first program beginners write is “Hello, World!” which is often used to illustrate the syntax of a programming language. You can take a look at the list of Hello World Programs in 300 Programming Languages to see how “Hello, World!” looks like in different programming languages.

Read More

Subscribe for updates

Join Over 20,000+ Readers