(C programming Example for Beginners) C Program to Multiply two Matrices by Passing Matrix to a Function In this example, you’ll learn to multiply two matrices and display it using user defined function. This program asks the user to enter the size of the matrix (rows and column). Then, it asks the user to enter …
(C programming Example for Beginners) C Program to Find Transpose of a Matrix In this example, you will learn to find the transpose of a matrix in C programming. The transpose of a matrix is a new matrix that is obtained by exchanging the rows and columns. In this program, the user is asked to …
(C programming Example for Beginners) C Program to Multiply Two Matrices Using Multi-dimensional Arrays In this example, you will learn to multiply two matrices and display it using user-defined functions. This program asks the user to enter the size (rows and columns) of two matrices. To multiply two matrices, the number of columns of the first …
(C programming Example for Beginners) C Program to Add Two Matrices Using Multi-dimensional Arrays In this example, you will learn to add two matrices in C programming using two-dimensional arrays. Program to Add Two Matrices #include <stdio.h> int main(){ int r, c, a[100][100], b[100][100], sum[100][100], i, j; printf(“Enter the number of rows (between 1 and …
(C programming Example for Beginners) C Program to Calculate Standard Deviation In this example, you will learn to calculate the standard deviation of 10 numbers using arrays. This program calculates the standard deviation of an individual series using arrays. Visit this page to learn about Standard Deviation. To calculate the standard deviation, we have created a …
(C programming Example for Beginners) C Program to Find Largest Element in an Array In this example, you will learn to display the largest element entered by the user in an array. Find the Largest Element in an array #include <stdio.h> int main(){ int i, n; float arr[100]; printf(“Enter the number of elements (1 to …
(C programming Example for Beginners) C Program to Calculate Average Using Arrays In this example, you will learn to calculate the average of n number of elements entered by the user using arrays. Store Numbers and Calculate Average Using Arrays #include <stdio.h> int main(){ int n, i; float num[100], sum = 0.0, avg; printf(“Enter the …
(C programming Example for Beginners) C program to calculate the power using recursion In this example, you will learn to calculate the power of a number using recursion. Program to calculate power using recursion #include <stdio.h> int power(int n1, int n2); int main(){ int base, a, result; printf(“Enter base number: “); scanf(“%d”, &base); printf(“Enter power …
(C programming Example for Beginners) C program to Reverse a Sentence Using Recursion In this example, you will learn to take a sentence from the user and reverse it using recursion. Reverse a sentence using recursion #include <stdio.h> void reverseSentence(); int main(){ printf(“Enter a sentence: “); reverseSentence(); return 0; } void reverseSentence(){ char c; scanf(“%c”, …
(C programming Example for Beginners) C Program to Convert Binary Number to Octal and vice-versa In this example, you will learn to convert binary numbers to octal and vice versa manually by creating a user-defined function. Program to Convert Binary to Octal In this program, we will first convert a binary number to decimal. Then, …