 # C Programming Code Examples

## C > Arrays and Matrices Code Examples

### Find the Biggest Number in an Array of Numbers using Recursion

``` Find the Biggest Number in an Array of Numbers using Recursion This C Program prints the largest number in an unsorted array of elements using recursion. The array used here is of type integer. #include <stdio.h> int large(int[], int, int); int main() { int size; int largest; int list; int j; printf("Enter size of the list:"); scanf("%d", &size); printf("Printing the list:\n"); for (j = 0; j < size ; j++) { list[j] = rand() % size; printf("%d\t", list[j]); } if (size == 0) { printf("Empty list\n"); } else { largest = list; largest = large(list, size - 1, largest); printf("\nThe largest number in the list is: %d\n", largest); } } int large(int list[], int size, int largest) { if (size == 1) return largest; if (size > -1) { if (list[size] > largest) { largest = list[size]; } return(largest = large(list, size - 1, largest)); } else { return largest; } } ```

C Program Code Calculate Simple Interest - C code example to input principle amount in some variable say principle and input time in some variable say time. Input rate in some variable say rate. Find simple interest using

Constant Definition by use const Keyword - What are "Constants"? Constants refer to as fixed values, unlike variables whose value can be altered, constants -- as the name implies does not change, they remain constant. And

The C Programming Pointers & 2D Arrays - As we know that the one "Dimensional Array" name works as a pointer to the base element of the Array. However in the case "2D Arrays" the logic is slightly different. You can consider

C Program to Display Factors of a Number - This C Program takes a Positive Integer from the user & displays all the positive factors of that number. The for loop is iterated until j<= Number is False. In each iteration, number is

Convert Binary Tree into Singly Linked List - C program converts a binary tree into a singly Linked List by Breadth first search algorithm. We use this algorithm for Traversing Level by Level. Structure type to point to the nodes of

Implementing the Bin Packing Algorithm - This is a sample program to illustrate the Bin-Packing algorithm using next fit heuristics. In the bin packing problem, objects of different volumes must be packed into a finite number

Finding ASCII Value of a Character in C++ - A character variable holds "ASCII value" (an "integer number" between 0 and 127) rather than that character itself in C programming. That value is known as ASCII value. Example

Search All Occurrences of a Word in String - C program to search all occurrences of a word in given string using loop. Input string & word from user. Run a Loop from 'starting index' of string to Length of string - word length. Enter