C Programming Tutorials

C Example for Beginners: C Program to Multiply two Matrices by Passing Matrix to a Function

(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 Example for Beginners: C Program to Multiply Two Matrices Using Multi-dimensional Arrays

(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 Example for Beginners: C Program to Add Two Matrices Using Multi-dimensional Arrays

(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 Example for Beginners: C Program to Calculate Standard Deviation

(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 Example for Beginners: C Program to Find Largest Element in an Array

(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 Example for Beginners: C Program to Calculate Average Using Arrays

(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 Example for Beginners: C program to calculate the power using recursion

(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 Example for Beginners: C program to Reverse a Sentence Using Recursion

(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 Example for Beginners: C Program to Convert Binary Number to Octal and vice-versa

(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, …