Author: learnconline

Program to find if a 3 by 3 square matrix is symmetric 14

Program to find if a 3 by 3 square matrix is symmetric

A symmetric matrix is a square matrix that is equal to its transpose. Let A be a symmetric matrix. Then, A = AT In this program, we need to check whether the given square matrix is symmetric or not. We will follow the steps given below. Step 1 – Accepts a square matrix as input Step 2 – Create a transpose of a matrix and store it in an array Step 3 – Check if input matrix is equal to its transpose or not If it is equal, then the input square matrix is symmetric. Here it goes… #include #include...

Program to obtain Transpose of a Matrix 5

Program to obtain Transpose of a Matrix

A transpose of a matrix is formed by turning all the rows of a given matrix into columns and vice-versa. The transpose of matrix A is written as AT Below is the program that will obtain transpose of 3 by 3 matrix. This program takes arr[3][3] matrix as input. It will then display its transpose matrix arrT[3][3]. #include #include void main(){ int arr[3][3], arrT[3][3]; int i,j; clrscr(); printf(“Enter the 3×3 matrix:\n”); for(i=0;i<3;i++) { for(j=0;j<3;j++) { printf(“Enter the element arr[%d][%d] : “,i,j); scanf(“%d”,&arr[i][j]); } } for(i=0;i<3;i++) { for(j=0;j<3;j++) { arrT[j][i] = arr[i][j]; } } printf(“The transpose of the matrix is: \n”);...

Program to perform addition of two 2 by 2 matrix 2

Program to perform addition of two 2 by 2 matrix

An array is a collective name given to a group of similar variables. In this program we will accept two 2-D array (2 by 2 Matrix) as input from the user. This program will then perform addition of two 2 by 2 matrix. It will then display the result after adding two matrix. Here is the program for matrix addition. If you found this article useful, do post a comment. #include #include void main(){ int arr1[10][10], arr2[10][10]; int arr3[][3]={ {0,0,0}, {0,0,0}, {0,0,0} }; int i, j; clrscr(); printf(“Enter 3×3 array 1:\n”); for(i=0;i<3;i++){ for(j=0;j<3;j++){ printf(“Enter element %d x %d:”,i,j); scanf(“%d”,&arr1[i][j]); }...

How to Install Turbo C++ Version 3.0, Compile and Run C Program 128

How to Install Turbo C++ Version 3.0, Compile and Run C Program

If you are looking for installing Eclipse for C, click here In this article, you will get answers to the following questions: How to Install Turbo C++ Version 3.0? How to create a new C Program using Turbo C++ Version 3.0? How to run a C Program using Turbo C++ Version 3.0? How to Install Turbo C++ Version 3.0? Installing Turbo C++ Version 3.0 is very easy and effortless. Follow below mentioned easy steps to install Tourbo C: Download Turbo C++ Version 3.0 folder on your desktop Extract TC.zip folder in your C Drive (“C:\”) Congratulation… You are done with...

Program to copy the contents of one array into another in the reverse order 7

Program to copy the contents of one array into another in the reverse order

The below mentioned program copies the content of one array name ‘source’ into another array named ‘dest’ in the reverse order. In case you have any queries related to the below mentioned program, please don’t hesitate to comment on this post. Your comments are always welcomed. #include #include void main(){ int source[100], dest[100],i,j,no; clrscr(); printf(“Enter the number of elements: “); scanf(“%d”,&no); for(i=0;i<no;i++){ printf(“Enter Source Array Element%d :”,i+1); scanf(“%d”,&source[i]); } for(i=0,j=no-1;i<no;i++,j–){ dest[j]=source[i]; } printf(“Destination array:\n”); for(i=0;i<no;i++){ printf(“%d\t”,dest[i]); } getch(); } Output: Enter the number of elements: 10 Enter Source Array Element1 :1 Enter Source Array Element2 :2 Enter Source Array Element3...

Structures in C Programming Language 32

Structures in C Programming Language

Structure is a special type of C data type. Structures contains a number of data types grouped together. Structures in C is one of the excellent functionality provided in C. Structures makes C Programming language easy and simpler up to certain extent. Structure is most widely used in Programming. Structures in C allows multiple data types to be grouped together. As a programmer I have used structures in C a lot and find this feature interesting too. Just go through this article and you too will find structures in C interesting. Let us suppose you want to store basic information...

FREE C Cheatsheet - Speed Up Your C Programming.

FREE C Cheatsheet - Speed Up Your C Programming.

Download a 7-page free cheat sheet for easy and quick access to C Concepts, Snippets, and Syntax.

Thank you! Check you inbox and access your cheat-sheet