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

Read more

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

Read more

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.

Read more

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,

Read more

C program to rotate bits of a number

Write a C program to input a number and rotate bits of number using bitwise shift operators. How to rotate bits of a given number using bitwise operator in C programming. Logic to left or right rotate bits of a number using bitwise shift operator in C program.

Example

Input

Input number = -15
Number of rotations = 2

Output

-15 left rotated 2 times = -57
-15 right rotated 2 times = 2147483644

Read more

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.

Read more

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

Read more

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

Read more

C program to copy one array to another using pointers

Write a C program to copy one array elements to another array using pointers. How to copy array elements from one array to another array using pointers. Logic to copy one array to another array using pointers in C programming.

Example

Input

Input array1 elements: 10 -1 100 90 87 0 15 10 20 30

Output

Array1: 10 -1 100 90 87 0 15 10 20 30
Array2: 10 -1 100 90 87 0 15 10 20 30

Read more