Global Variable in C

Global variables in C are declared outside any functions and usually at the top of the program as shown below. They can be used in the program inside any block of code. Properties of a Global Variable: Global variables are defined outside a function, usually on top of the program. The lifetime of a Global … Read more

Local Variable in C

A variable that is declared within the body of the function or block is called a local variable. This variable is used only within that block or function where it was created, other classes cannot access it. And is destroyed after exiting the block. Properties of a Local Variable: A local variable is allocated on … Read more

Kruskal’s Algorithm in C

In this article, you will learn the implementation of Kruskal’s Algorithm in C programming and starting with Kruskal’s Algorithm. Kruskal’s Algorithm It is a greedy algorithm that is directly based on MST (Minimum Spanning Tree). Kruskal’s algorithm finds a minimum spanning tree for a connected weighted graph. It finds a subset of the edges that … Read more

Dining Philosophers problem in C

In this article, you will learn about the C program to solve Dining Philosophers problem. The Dining Philosophers Problem: Let there be 5 philosophers (for example) sitting around a round table for dinner. Each philosopher needs two forks to eat but there are only 5 forks (equal to the number of philosophers around the table). … Read more

Round Robin Scheduling in C

This article contains the implementation of the Round Robin Scheduling in C Programming with the explanation, an example, it’s advantages and disadvantages. If we consider large management or organization with multi-users and with a time-sharing system, in such cases response time plays a vital role in the achievements of various objectives. So, Process Scheduling is … Read more

Bit Stuffing Program in C

This post contains the implementation of Bit Stuffing in C programming. Learn about bit-stuffing and with source code for Bit Stuffing in c. What is Bit Stuffing? Bit Stuffing is the technique of insertion of one or more extra bits (0) into data. These are the non–information bits as a way to provide signaling information … Read more

C – Frequently Asked Question/Interview Questions

This is an article prepared for you to answer all the frequently asked questions (short or long) in C and more. This listed FAQ is also prepared for interview questions that you may prepare through it. Not only about C but also about the compilers and headers used, etc. Although right now only a few … Read more

C – Storage Class

Every variable has a storage class that defines the characteristics of the variable. It tells the compiler where to allocate memory for a variable, it also determines the scope of the variable, visibility, and lifetime of a variable. There are four types of storage classes: Automatic External Static Register Automatic(auto) Storage class: A variable defined … Read more

C – Dynamic Memory Allocation

In this tutorial, you will learn how to dynamically allocate memory in C program using 4 standard library functions: malloc(), calloc(), free() and realloc() with examples. You will also learn the difference between malloc and calloc at the end. Dynamic Memory Allocation The main concept of dynamic memory allocation in c programming enables the programmer … Read more

C – Preprocessors

As the “pre” means beforehand, similarly it means processing something before passing it on further. The preprocessor is a program that processes the source program before it is passed to the compiler. So we can say that it is a separate process in the compilation. Preprocessor commands (often known as directives) form what can almost … Read more