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 »

C Program to reverse a given number

In this example, you will learn to reverse the given number using these two methods. Examples : Input : 123 Output : 321 Input : 1995 Output : 5991 Approach used : We can reverse a number in c using loop and arithmetic operators. Take input number Find its quotient and remainder. Multiply the separate variable with 10… 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 »