History of C language

In 1965, Bell Telephone Laboratories, General Electric Company and Massachusetts Institute of Technology where working together to develop a new operating system called MULTICS. In 1969, Bell Laboratories ended its participation in the project. However, the participating members of Bell Labs, mainly Ken Thompson and Dennis Ritchie, still had an intention to create such kind … Read more

Why learn C?

One may argue that if there is plethora of programming languages available, then what makes C language so special? There are two answers to this question. First, C language has been used by programmers for past 30-40 years to develop every kind of utility. This means the language is well understood, the issues with the … Read more

Introduction to C Programming Language

In order to communicate any idea, thought, instruction or information, humans make use of spoken language. The fact is that you have just understood the very first sentence of this chapter all due to that. However, spoken languages are not understood by machines. Not only machines but also other living creatures of this planet do … Read more

Why is the C language important?

The following list illustrates the importance the C programming language, in no particular order: The C language is small and relatively easy to learn. C compilers can produce highly efficient code. C compilers and cross-compilers are widely available for a large array of hardware targets, from tiny eight-bit microcontrollers to giant mainframes. The availability of … Read more

C program to print digital clock with current time

#include <stdio.h> #include <time.h>   int main() {     time_t s, val = 1;     struct tm* current_time;        s = time(NULL);        current_time = localtime(&s);       printf(“%02d:%02d:%02d”,            current_time->tm_hour,            current_time->tm_min,            current_time->tm_sec);       return 0; }

Pointers in C Programming

A pointer is a variable that stores the address of another variable. Unlike other variables that hold values of a certain type, pointer holds the address of a variable. For example, an integer variable holds (or you can say stores) an integer value, however an integer pointer holds the address of a integer variable. In … Read more

Structure in C programming

Structure is a group of variables of different data types represented by a single name. Lets say we need to store the data of students like student name, age, address, id etc. One way of doing this would be creating a different variable for each attribute, however when you need to store the data of … Read more

Function call by reference in C Programming

Before we discuss function call by reference, lets understand the terminologies that we will use while explaining this: Actual parameters: The parameters that appear in function calls. Formal parameters: The parameters that appear in function declarations. For example: We have a function declaration like this: int sum(int a, int b); The a and b parameters … Read more

Strings and String functions in c

String is an array of characters. In this post, we learn how to declare strings, how to work with strings in C programming and how to use the pre-defined string handling functions. We will see how to compare two strings, concatenate strings, copy one string to another & perform various string manipulation operations. We can … Read more

goto statement in c programming

The goto statement is rarely used because it makes program confusing, less readable and complex. Also, when this is used, the control of the program won’t be easy to trace, hence it makes testing and debugging difficult. goto statement When a goto statement is encountered in a C program, the control jumps directly to the … Read more