Category: C programming

python tutorials and learn python

Created with Sketch.

C program to insert an element in an array

  C program to insert an element in an array C program to insert an element in an array, for example, consider an array a[10] having three elements in it initially and a[0] = 1, a[1] = 2 and a[2] = 3 and you want to insert a number 45 at location 1 i.e. a[0]…
Read more

C program to delete an element from an array

  C program to delete an element from an array C program to delete an element in an array: This program deletes or removes an element from an array. A user will enter the position at which the array element deletion is required. Deleting an element does not affect the size of the array. It…
Read more

C program to merge two arrays

  C program to merge two arrays C program to merge two arrays into another array. They are assumed to be sorted in ascending order. A user inputs them; the program combines them to get a larger array. If they aren’t in ascending order, we can sort them and then use the merge function. Another…
Read more

Bubble sort in C

  Bubble sort in C Bubble sort in C to arrange numbers in ascending order, you can modify it for descending order and can also sort strings. The bubble sort algorithm isn’t efficient as its average-case complexity is O(n2) and worst-case complexity is O(n2). There are many fast sorting algorithms like Quicksort, heap-sort, and others.…
Read more

Insertion sort in C

  Insertion sort in C Insertion sort in C: C program for insertion sort to sort numbers. This code implements insertion sort algorithm to arrange numbers of an array in ascending order. With a little modification, it will arrange numbers in descending order. Best case complexity of insertion sort is O(n), average and the worst…
Read more

Selection sort in C

  Selection sort in C Selection sort in C to sort numbers of an array in ascending order. With a little modification, it arranges numbers in descending order. Selection sort algorithm (for ascending order): Find the minimum element in the array and swap it with the element in the 1st position. Find the minimum element…
Read more

Matrix addition in C

  Matrix addition in C Matrix addition in C language to add two matrices, i.e., compute their sum and print it. A user will input the order of matrix (number of rows and columns) and two matrices. For example, if the order is 2, 2, i.e., two rows and two columns and the matrices are:…
Read more

Subtract matrices

  Subtract matrices C code to subtract matrices of any order. This program finds the difference between corresponding elements of two matrices and then print the resultant matrix. C programming code #include <stdio.h> int main() { int m, n, c, d, first[10][10], second[10][10], difference[10][10]; printf(“Enter the number of rows and columns of matrix\n“); scanf(“%d%d”, &m,…
Read more

Transpose of a matrix in C

Transpose of a Matrix in C Introduction The transpose of a matrix is a fundamental operation in linear algebra, where the rows of a matrix are swapped with its columns. This operation is essential in various mathematical and computational applications. In this blog post, we will explore the concept of matrix transposition, understand the algorithm…
Read more

Matrix multiplication in C

  Matrix multiplication in C