## How to declare, initialize and access array of structure

Write a C program declare, initialize and access array of structure. In this post, I will explain how to declare, initialize and access array of structure in C programming. We will learn different ways of initializing structure array and accessing its.

## How to return multiple value from function in C programming?

Write a C program to return multiple value from function. How to return more than one value from function in C programming? Different ways to return multiple value from function in C programming.

## C program to multiply two matrix using pointers

Write a C program to multiply two matrix using pointers. How to input and multiply two matrix using pointer in C programming. Logic to multiply two matrix using pointer in C.

Example

Input

Input elements of matrix1:
10 20 30
40 50 60
70 80 90
Input elements of matrix2:
1 2 3
4 5 6
7 8 9

Output

Product of matrices is :
300 360 420
660 810 960
1020 1260 1500

## C program to add two matrix using pointers

Write a C program to add two matrix using pointers. C program to input two matrix from user and find sum of both matrices using pointers.

Example

Input

Input matrix1:
1 2 3
4 5 6
7 8 9
Input matrix2:
9 8 7
6 5 4
3 2 1

Output

Sum of both matrices:
10 10 10
10 10 10
10 10 10

## How to access two dimensional array using pointers in C programming?

How to access two dimensional array using pointers in C programming? Write a C program to input and print elements of a two dimensional array using pointers and functions.

Example

Input

Input elements in 3x3 matrix:
1 2 3
4 5 6
7 8 9

Output

Elements of 3x3 matrix:
1 2 3
4 5 6
7 8 9

## How to pass and return array from function in C?

Functions makes our program modular and maintainable. Big applications can have hundreds of functions.

Array is a data structure to store homogeneous collection of data. Arrays are equally important as functions. In programming we often use arrays and functions together.

Here in this post I will explain how to pass and return array from function in C programming.

## C program to sort an array using pointers

Write a C program to input elements in an array and sort array using pointers. How to sort an array in ascending or descending order using function pointers in C programming. Logic to sort an array using pointers in program.

Example

Input

Input array elements: 10 -1 0 4 2 100 15 20 24 -5

Output

Array in ascending order: -5, -1, 0, 2, 4, 10, 15, 20, 24, 100,
Array in descending order: 100, 24, 20, 15, 10, 4, 2, 0, -1, -5,

## C program to search element in array using pointers

Write a C program to input elements in array and search an element in array using pointers. How to search an element in array using pointers in C programming. Logic to search an element in array using pointers in C program.

Example

Input

Input array elements: 10 20 30 40 50 60 70 80 90 100
Input element to search: 25

Output

25 does not exists in array.

## C program to reverse an array using pointers

Write a C program to input elements in an array and reverse the array using pointers. How to reverse an array using pointers in C programming. Logic to reverse an array using pointers in C.

Example

Input

Input array elements: 10 20 30 40 50 60 70 80 90 100

Output

Reversed array: 100 90 80 70 60 50 40 30 20 10

## C program to swap two arrays using pointers

Write a C program to swap corresponding elements of two arrays using pointers. How to swap two arrays using pointers in C program. Logic to swap two arrays of different length using pointers in C programming.

Example

Input

Input first array: 10 20 30 40 50 60 70 80 90 100
Input second array: 0 9 8 7 6 5 4 3 2 1

Output

First array after swapping: 0 9 8 7 6 5 4 3 2 1
Second array after swapping:  10 20 30 40 50 60 70 80 90 100