C Program to find the sum of all diagonal elements of a given matrix. Loop variable i - represents rows Loop variable j - represents columns diagonal elements are those where indexes i==j
Hi sir I ran your program and it did not work. However, when I take out the scanf and the two nested for loops for scanf, and declare the A matrix from 1-9; it works. How do I get input from user instead of having one fixed matrix?
The program is understandable but it would've been better if you explain it in Visual Studio/Dev C or other software... Because it's really hard to understand the brackets and their position
Sir,At the end you are saying that row and column numbers may be different,But Only square matrices have diagonals and for square matrices rows and columns must be equal
hi monika sorry for the delay and soon i will try to upload it. thanks for your interest towards our channel and share my sessions with your friends and subscribe to our channel.Keep following our channel.
hi hardik definitely i will try to upload the program with in two or three days. I would like to have a feedback from you so please make a selfie video with a feedback regarding our channel and send to my WhatsApp number 9885 466 061 expecting a feedback from you I will collect all the feedback and I will upload the feedback in my channel.
hi vamsi soon i will do that thanks for your interest towards our channel and share my sessions with your friends and subscribe to our channel.Keep following our channel.
#include #define SIZE 3 // Matrix size int main() { int A[SIZE][SIZE]; int row, col, sum = 0; /* Input elements in matrix from user */ printf("Enter elements in matrix of size %dx%d: ", SIZE, SIZE); for(row=0; row
Sir you are very hardworking. My best wishes are with you thanks a lot
THANK YOU SIR ...respect form MEGHNAD SAHA INSTITUTE OF TECHNOLOGY.(KOLKATA).
Super... Sir.. Well explained...... I gain some knowledge from ur video... Tq sir...
sir what about the opposite diagonal element
In 2nd part of program sir you could use
For(i=0;i
1st program----
#include
int main()
{
int arr[10][10],rowsize,colsize,sum=0,i,j;
printf("enter rowsize :");
scanf("%d", & rowsize);
printf("enter colsize :");
scanf("%d", & colsize);
printf("enter %d elements :",rowsize*colsize); //In 2D array total no. of elements = rows*columns =i*j .....
for(i=0;i
Thank you brioooo
Thank you sir for making this difficult program so easy.
You are like as doctor❤❤
Sir.. I think in second part it should be i
Gud explaination nd easy to understand sir ..thank u sir
Hi sir I ran your program and it did not work. However, when I take out the scanf and the two nested for loops for scanf, and declare the A matrix from 1-9; it works. How do I get input from user instead of having one fixed matrix?
It is very helpful👍🏻👍🏻
if you take 3 matrix element [3]={0,1,2,3} or {1,2,3,4}
superb explanation sir
Sir I can understand your teaching , your really great😎😎😘
Sir, what is program about second diagonal of matrix
Yes i want it too both side diagonal.
😘🥰😍
Very good sir keep teaching
The program is understandable but it would've been better if you explain it in Visual Studio/Dev C or other software... Because it's really hard to understand the brackets and their position
Tq sir... Very useful video... 🤝
there is a way to do this in recursion? good video!
Thank you sooo much sir!
Sir,At the end you are saying that row and column numbers may be different,But Only square matrices have diagonals and for square matrices rows and columns must be equal
Yes bro, i am also confused... My teacher have also given question - WAP to print sum of diagonal of matrix m x n.
sir you are great
Helpful video
thanku you are so cute as c++ programming
Hi sana khan thanks for watching my sessions and supporting our channel.
Thanks sir very nice video
but one little late as the output shows 25
nothing else is the program wrong
Sir what can we do if we have to find sum of elements above diagonal elements
Can u teach right diagonal matrix
nice explanation,,,thanks
Hey the program isn't running......
Sir both side left and right side sum of diagonalas ka video bana dijiye hindi me peoples wants it.
Sir plz creat programs on sum of every digonal s means
👍👍👍👍
Watching in 2023 exam tomorrow
thank you sir , sir please upload a video for quick sort
hi monika
sorry for the delay and soon i will try to upload it.
thanks for your interest towards our channel and share my sessions with your friends and subscribe to our channel.Keep following our channel.
Ty sir👍
When uve already taken a 3x3 matrix why to use scanf? What are you asking the user?
#include
#include
main()
{
int i,j,sum=0,A[3][3]={1,2,3,4,5,6,7,8,9};
clrscr();
for(i=0;i
Sir already takken size not an element.so thats y.
Thank you very much Sir
hi Adarsh
Thanks for your interest and support towards our channel.
sir I want program for addition of matrix... plz can u help me sir..
hi hardik
definitely i will try to upload the program with in two or three days.
I would like to have a feedback from you so please make a selfie video with a feedback regarding our channel and send to my WhatsApp number 9885 466 061 expecting a feedback from you I will collect all the feedback and I will upload the feedback in my channel.
Never hardcode the bounds in any loop condition. You code is not dynamic.
can u please tell me how to find out sum for another diagonal in the same matrix..
hi vamsi
soon i will do that
thanks for your interest towards our channel and share my sessions with
your friends and subscribe to our channel.Keep following our channel.
How to calculate sum of diagonal from right dide
hi MD
i will try to upload it.
intialize any variable
int y=0;
Then in loop after displaying entered matrix,
for(i=0;i
sir please upload videos about pointers please sir
hi manoj
th-cam.com/video/kKKvGYAX_Zs/w-d-xo.html
how to do working of this program
hi sir
Hi chikkanti manojkumar
#include
#define SIZE 3 // Matrix size
int main()
{
int A[SIZE][SIZE];
int row, col, sum = 0;
/* Input elements in matrix from user */
printf("Enter elements in matrix of size %dx%d:
", SIZE, SIZE);
for(row=0; row