coderz.py

Keep Coding Keep Cheering!

Unions in C

A union is a particular data type in C that allows several data types to be stored in the same memory address. A union can have numerous members, but only one member can have value at any given time. Unions are a convenient approach to use the same memory region for numerous purposes. Both Structures […]

March 26, 2022 | C | No comments

Typedef in C

Typedef in C is used to redefine the name of the existing variable type. It generally increases the readability and convenience of complex data types. Syntax: For instance, consider the following statement in which the type unsigned long int is redefined to be of the type TWOWORDS: Thus, typedef in C provides a short and […]

March 24, 2022 | C | No comments

Nested Structure in C

C allows us to nest one structure within another structure, which allows us to design complicated data types. This type of structure is known as nested structure. For example, we may need to store the result of an entity student in a structure. The attribute result may also have the subparts like subject name, marks, […]

March 22, 2022 | C | No comments

Array of Structure

Array of Structure: In C, an array of structures is a collection of many structure variables, each of which has information on a different entity. An array of structures is used in C to store information about several entities of various data types. The collection of structures is another name for the array of structures. […]

March 21, 2022 | C | No comments

Structure in C

The structure is a user-defined data type in C that allows us to aggregate data of various types. Structure aids in the creation of a more understandable data type. Need for Structure in C: There are times when we need to keep several characteristics of an entity in C. An entity does not need to have […]

March 19, 2022 | C | No comments

Two-dimensional array

The two-dimensional array can be defined as an array of arrays. The 2D array is organized as matrices, which can be represented as the collection of rows and columns. However, 2D arrays are created to implement a relational database lookalike data structure. It provides ease of holding the bulk of data at once, which can […]

March 17, 2022 | C | No comments

One-dimensional Array

A one-dimensional array is one that only needs one subscript statement to show a single array element. A one-dimensional array is an organized set of parts(also known as array elements) that can be accessed separately by defining the component’s position with a single index value. Declaring a One Dimensional Array: Before using an array variable […]

March 16, 2022 | C | No comments

Arrays in C

Arrays in the C language are a set of homogenous data types stored at the contiguous memory location. We can define one array variable to describe individual variables rather than specifying separate variables. An index lets you access a distinct element in an array. Structure of an array: Key points: Each element of an array has the same data type and size, such as int = 4 bytes. The array’s elements are kept in contiguous memory regions, with the first element kept in the smallest memory place. Because we can determine the address of each element of the array with the given base address and the size of the data element, we can access elements of the array at random. Array Declaration: We can declare an array in the c language in the following way: The array size must be a positive integer constant, and the type […]

March 14, 2022 | C | No comments

Program to check whether a number is even or odd

To determine whether an integer number is even or odd, utilize functions. We have created a function even_odd(int n) with the return type is int and has parameter n. The parameter n is tested to see if it is divisible by two. If the condition is true, then n will be an even number; otherwise, […]

March 13, 2022 | C | No comments

Recursive function in C

In the C programming language, a function may call itself. A function is called recursive if a statement within the body of the function calls the same function. Sometimes called ‘circular definition’- therefore, recursion is the process of defining something in terms of itself. Recursion cannot be applied to all the problems, but it is […]

March 11, 2022 | C | No comments

Advertisement