Break and Continue Statement in C with Example

Break and Continue statements in C are looping control statements. Based on the break and continue statement loop can be broken or skipped break and continue both are keywords. break – Uses to break the loop and also use with a switch to break the switch case. continue– skip the current execution of the loop … Read more

Array of pointers in C Programming

Example: Write a program to assign the address of array elements to pointer variable and print the array element with address. #include int main () { int arr[] = {10, 20, 30}; int i, *ptr[3]; for ( i = 0; i < 3; i++) { ptr[i] = &arr[i]; // assign the address array element to ... Read more

Functions in C Programming

In a C programming language a function is a group of statements that together perform a special task. In every C program has at least one function, which is main(). In a C library has a numerous predefined or built-in functions. For example, strcat() to concatenate two strings, main() from where program execution starts.  In a C programming … Read more

NULL Pointers in C Programming

A pointer that is assigned NULL is called a null pointer. We must initialize NULL pointer during variable declaration. A null pointer refers to pointer variable that does not point to a valid address. Generally NULL pointer is used when you do not have an exact address to be assigned. #include int main () { int *ptr … Read more

Multi-dimensional Array in C Programming

C programming language also support multidimensional arrays. Syntax of multidimensional array declaration: Data_type    array_name[size1][size2]…[sizeN]; For example, if we want to creates a three dimensional integer array − int  num[5][10][4]; Two-dimensional Arrays The simplest form of multidimensional array is the two-dimensional array. if we want to declare a two dimensional integer array of size [x][y] ( … Read more

Pointer to Pointer in C Programming

In  C language, a pointer is an address. Normally, a pointer variable contains the address of a another variable.  A pointer to a pointer is a chain of pointers.  Or Pointer to pointer means one pointer variable holds the address of another pointer variable. #include int main() { int a=4; int *b, **c; b = … Read more

Pointers in C Programming

In    programming, variable is used to hole the value & this variable stored in a memory.  Each variable has a address to identify where these variables actually stored in a memory.     In a C programming language, pointer is a variable which can hold the address of another variable.   Accessing Address of Variable In … Read more

Recursion in C Programming

In C programming language, a function that calls itself is known as a recursive function. And, this technique is called as recursion.  Recursive functions are very useful to solve many problems such as  Towers of Hanoi (TOH), Inorder/Preorder/Postorder Tree Traversals, DFS of Graph, etc. How recursion works? void recurse() { … .. … recurse(); … .. … … Read more