Tag Archives: C-Basic

Strings in C

In this article, you’ll learn about strings in C programming. Strings are defined as an array of characters. The difference between a character array and a string is the string is terminated with a special character ‘\0’. Example : char name[] = “first name” ; Declaration of strings : When the compiler encounters a sequence of characters enclosed… Read More »

Union in C

In this article, you’ll learn about unions in C programming. More specifically, how to create unions, access its members and learn the differences between unions and structures. User defined data type : Union Like structures in C, union is a user defined data type. In union, all members share the same memory location. Unions are conceptually similar to… Read More »

Structures in C

A structure is a user defined data type in C. A structure creates a data type that can be used to group items of possibly different types into a single type. Structure is similar as Array, but only difference is that array allows only similar data type that can be stored in contiguous manner, but structure can stores… Read More »

Data Types in C | Set 1

Data types define the type of data a variable can hold. C language has some predefined set of data types to handle various kinds of data that we can use in our program. These datatypes have different storage capacities. In C programming, data types are declarations for variables. This determines the type and size of data associated with… Read More »

C standard library

Prerequisite – C language C standard library (libc) is the standard library for the C programming language, as specified in the ANSI C standard. C standard library is also called the ISO C library. The C library functions are provided by the system and stored in the library. The C library function is also called an in-built function… Read More »

Functions in C

A function is a block of code that performs a specific task. It is a set of statements that take inputs, do some specific computation and produces output. A function can be called multiple times to provide reusability and modularity to the C program. Example : Advantage of functions in C : There are the following advantages of… Read More »

Loops in C | Set 2

Loops are very useful when you want to perform a task repeatedly. Loops are used to execute a set of statements repeatedly until a particular condition is satisfied. A loop consists of two parts, a body of a loop and a control statement. The purpose of the loop is to repeat the same code a number of times.… Read More »

Decision Making in C

C conditional statements allow you to make a decision, based upon the result of a condition. These statements are called Decision Making Statements or Conditional Statements. Decision making statements available in C are: if statement if..else statements nested if statements if-else-if ladder switch statements Jump Statements: break continue goto return 1. if statement – If a certain condition… Read More »