C program to find maximum and minimum elements in array using recursion

Write a C program to find maximum and minimum elements in an array using recursion. How to find maximum and minimum element in an array using recursion in C programming. Logic to find find maximum or minimum elements in array in C programming.

Example

Input

Size of array: 10
Elements in array: 5, 1, 6, 10, 2, 3, 6, 50, -7, 4

Output

Maximum element = 50
Minimum element = -7

Read more

C program to find sum of array elements using recursion

Write a C program to find sum of array elements using recursion. How to find sum of array elements using recursive function in C programming. Logic to find sum of array elements using recursion in C program.

Example

Input

Input size of array: 10
Input array elements: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Output

Sum of array: 55

Read more

C program to print elements of array using recursion

Write a C program to print all elements of array using recursion. How to display all elements of an array using recursion. Logic to print array elements using recursion in C programming.

Example

Input

Input size: 10
Input elements: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Output

Array elements: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Read more

C program to sort even and odd elements of array separately

Write a C program to input elements in an array from user and sort all even and odd elements of the given array separately without using any other array. If minimum element of the array is even then all even elements should be placed in sorted order before odd elements otherwise all odd elements should be placed first. How to sort all even and odd elements of a given array separately in C programming.

Example

Input

Input size of array: 10
Input elements of array: 0 5 1 2 3 4 6 12 10 9

Output

Output in sorted order: 0 2 4 6 10 12 1 3 5 9

Read more

C program to put even and odd elements of array in two separate array

Write a C program to input elements in array and put even and odd elements in separate array. How to separate even and odd array elements in two separate array containing only even or odd elements using C programming.

Example

Input

Input size of the array: 10
Input elements in array: 0 1 2 3 4 5 6 7 8 9

Output

Output even elements in array: 0 2 4 6 8
Output odd elements in array: 1 3 5 7 9

Read more

C program to find second largest number in array

Write a C program to find largest and second largest element in an array. How to find second largest element in array in C programming language. Logic to find second largest element in array in C program.

Example

Input

Input array elements: -7 2 3 8 6 6 75 38 3 2

Output

Second largest = 38

Read more

Queue implementation using array, enqueue and dequeue in C

Write a C program to implement queue, enqueue and dequeue operations using array. In this post I will explain queue implementation using array in C programming. We will learn how to implement queue data structure using array in C language. And later we will learn to implement basic queue operations enqueue and dequeue.

Read more

C program to find sum of lower triangular matrix

Write a C program to read elements in a matrix and find sum of lower triangular matrix. How to find sum of lower triangular matrix in C. Logic to find sum of lower triangular matrix in C programming.

Example

Input

Input elements in matrix:
1 0 0
4 5 0
7 8 9

Output

Sum of lower triangular matrix = 19

Read more

C program to find sum of upper triangular matrix

Write a C program to read elements in a matrix and find sum of upper triangular matrix. How to find sum of upper triangular matrix in C. Logic to find sum of upper triangular matrix.

Example

Input

Input matrix elements: 
1 2 3
0 5 6
0 0 9

Output

Sum of upper triangular matrix = 11

Read more