Category: C program

python tutorials and learn python

Created with Sketch.

C Program to Multiply two Matrices by Passing Matrix to a Function

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 the elements of those matrices…
Read more

C Program to Find Transpose of a Matrix

C Program to Find Transpose of a Matrix This program takes a matrix of order r*c from the user and computes the transpose of that matrix. In this program, user is asked to entered the number of rows r and columns c. The value of r and c should be less than 10 in this…
Read more

C Program to Multiply to Matrix Using Multi-dimensional Arrays

C Program to Multiply to Matrix Using Multi-dimensional Arrays This program takes two matrices of order r1*c1 and r2*c2 respectively. Then, the program multiplies these two matrices (if possible) and displays it on the screen. To multiply two matrices, the number of columns of first matrix should be equal to the number of rows to…
Read more

C Program to Add Two Matrices Using Multi-dimensional Arrays

C Program to Add Two Matrices Using Multi-dimensional Arrays This program takes two matrices of order r*c and stores it in two-dimensional array. Then, the program adds these two matrices and displays it on the screen. In this program, user is asked to entered the number of rows r and columns c. The value of…
Read more

C Program to Calculate Standard Deviation

C Program to Calculate Standard Deviation This program calculates the standard deviation of 10 data using arrays. This program calculates the standard deviation of a individual series using arrays. Visit this page to learn about Standard Deviation. To calculate the standard deviation, calculateSD() function is created. The array containing 10 elements is passed to the…
Read more

C Program to Find Largest Element in an Array

C Program to Find Largest Element in an Array This program takes n number of element from user (where, n is specified by user) and stores data in an array. Then, this program displays the largest element of that array using loops. Example: Display Largest Element of an array #include <stdio.h> int main() { int…
Read more

C Program to Calculate Average Using Arrays

C Program to Calculate Average Using Arrays This program takes n number of element from user (where, n is specified by user), stores data in an array and calculates the average of those numbers. Source Code to Calculate Average Using Arrays #include <stdio.h> int main() { int n, i; float num[100], sum = 0.0, average;…
Read more

C program to calculate the power using recursion

C program to calculate the power using recursion This program calculates the power of a number using recursion. Example: Program to calculate power using recursion #include <stdio.h> int power(int n1, int n2); int main() { int base, powerRaised, result; printf(“Enter base number: “); scanf(“%d”,&base); printf(“Enter power number(positive integer): “); scanf(“%d”,&powerRaised); result = power(base, powerRaised); printf(“%d^%d…
Read more

C program to Reverse a Sentence Using Recursion

C program to Reverse a Sentence Using Recursion This program takes a sentence from user and reverses that sentence using recursion. This program does not use string to reverse the sentence or store the sentence. Example: Reverse a sentence using recursion /* Example to reverse a sentence entered by user without using strings. */ #include…
Read more

C Program to Convert Binary Number to Octal and vice-versa

C Program to Convert Binary Number to Octal and vice-versa In this example, you will learn to convert binary number to octal and octal number to binary manually by creating a user-defined function. Example¬†1: Program to Convert Binary to Octal In this program, we will first convert binary number to decimal. Then, the decimal number…
Read more