answersLogoWhite

0


Best Answer

#include <stdio.h> void main() { int a,b,c,i,j; printf("Enter the number of rows for square matrix : "); scanf("%d",&a); for(i=1;i<=a;i++) { for(c=1,j=1;j<=a;j++,c++) { if(c==i) printf("1 "); else printf("0 "); } printf("\n"); } getch(); }

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to display Identity matrix?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program to multiply 33 matrix.?

write a program to multily 3*3 matrix.


Write a C program using dynamic memory allocation to find the sum of elements of a matrix?

Did you know that memory allocation is not needed to display the matrix? However, the C program is to find the sum of all the elements.


How can you write a program which proves that a multiple of a matrix and its determinant is an identity matrix?

Automated proofs are a complicated subject. If you are not an expert on the subject, all you can hope for is to write a program where you can input a sample matrix (or that randomly generates one), and verifies the proposition for this particular case. If the proposition is confirmed in several cases, this makes the proposition plausible, but is by no means a formal proof.Better try to prove it without writing any program.Note: it is not even true; it is the inverse of the matrix which gives identity when is multiplied with the original matrix.


2x2 matrix multiplication program in 8085 processor?

how to write a program for matrix multiplication in microprocesspr


How do you Write A program in c language for checking a diagonal matrix?

Write a program in c++ that take input in a integer matrix of size 4*4 and find out if the entered matrix is diagonal or not.


A c program to square matrix?

A C program to square matrix is a math problem. In the math problem you write down all the outer boundary values of matrix in a circle, then write down the inner value.


Write a c program to find eigenvalue of a matrix?

Yes, do write. That's what you always have to do when you have got a homework-program.


How do you write a java program to find the transpose of the matrix for the given elements?

You basically write a nested for loop (one for within another one), to copy the elements of the matrix to a new matrix.


How do you write a java program to find the ad joint of a matrix?

bgfygfrhjyuyhh


Write a program to print the sum of a sparse matrix?

This is a directive, not a question.


Write a C program to find sum of 3 matrices?

matrix


Write a c program for matrix addition using function?

#include&lt;