42 - SUM OF DIAGONAL ELEMENTS OF MATRIX - C PROGRAMMING

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ต.ค. 2024
  • 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

ความคิดเห็น • 63

  • @parth7450
    @parth7450 5 ปีที่แล้ว +3

    Sir you are very hardworking. My best wishes are with you thanks a lot

  • @souviknandi5792
    @souviknandi5792 3 ปีที่แล้ว +1

    THANK YOU SIR ...respect form MEGHNAD SAHA INSTITUTE OF TECHNOLOGY.(KOLKATA).

  • @want8718
    @want8718 2 ปีที่แล้ว

    Super... Sir.. Well explained...... I gain some knowledge from ur video... Tq sir...

  • @krishnakc2196
    @krishnakc2196 5 ปีที่แล้ว +6

    sir what about the opposite diagonal element

  • @subhamagarwal8554
    @subhamagarwal8554 5 ปีที่แล้ว +1

    In 2nd part of program sir you could use
    For(i=0;i

  • @sujitsah7223
    @sujitsah7223 4 ปีที่แล้ว +1

    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

  • @enriquethomasjoseph4408
    @enriquethomasjoseph4408 ปีที่แล้ว

    Thank you sir for making this difficult program so easy.

  • @Cslover-j4z
    @Cslover-j4z ปีที่แล้ว

    You are like as doctor❤❤

  • @puttapallisatishyadav222
    @puttapallisatishyadav222 3 ปีที่แล้ว

    Sir.. I think in second part it should be i

  • @kousalyad9697
    @kousalyad9697 2 ปีที่แล้ว

    Gud explaination nd easy to understand sir ..thank u sir

  • @giaotran6910
    @giaotran6910 5 ปีที่แล้ว +2

    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?

  • @arshpr__t
    @arshpr__t ปีที่แล้ว

    It is very helpful👍🏻👍🏻

  • @Safal_here
    @Safal_here 2 ปีที่แล้ว +2

    if you take 3 matrix element [3]={0,1,2,3} or {1,2,3,4}

  • @deepapokhalekar7932
    @deepapokhalekar7932 4 ปีที่แล้ว +1

    superb explanation sir

  • @aswins8532
    @aswins8532 5 ปีที่แล้ว

    Sir I can understand your teaching , your really great😎😎😘

  • @surajpatil6623
    @surajpatil6623 6 ปีที่แล้ว +4

    Sir, what is program about second diagonal of matrix

    • @ronnygamerz88
      @ronnygamerz88 3 ปีที่แล้ว

      Yes i want it too both side diagonal.

  • @rajavelu539
    @rajavelu539 ปีที่แล้ว +1

    😘🥰😍

  • @rimjhimshukla-1798
    @rimjhimshukla-1798 4 ปีที่แล้ว

    Very good sir keep teaching

  • @its_LABRO
    @its_LABRO 2 ปีที่แล้ว

    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

  • @13kaviya.g51
    @13kaviya.g51 3 ปีที่แล้ว

    Tq sir... Very useful video... 🤝

  • @JerSem
    @JerSem 3 ปีที่แล้ว

    there is a way to do this in recursion? good video!

  • @rikeshshrestha666
    @rikeshshrestha666 4 ปีที่แล้ว +1

    Thank you sooo much sir!

  • @upendarreddymusuku8878
    @upendarreddymusuku8878 4 ปีที่แล้ว

    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

    • @mypersonal246
      @mypersonal246 2 หลายเดือนก่อน

      Yes bro, i am also confused... My teacher have also given question - WAP to print sum of diagonal of matrix m x n.

  • @prensudangol1547
    @prensudangol1547 2 ปีที่แล้ว

    sir you are great

  • @gamingdas396
    @gamingdas396 2 ปีที่แล้ว

    Helpful video

  • @sanakhan-mo6vl
    @sanakhan-mo6vl 6 ปีที่แล้ว +4

    thanku you are so cute as c++ programming

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +1

      Hi sana khan thanks for watching my sessions and supporting our channel.

  • @SanaSana-hg3cr
    @SanaSana-hg3cr 5 ปีที่แล้ว

    Thanks sir very nice video

  • @prensudangol1547
    @prensudangol1547 2 ปีที่แล้ว

    but one little late as the output shows 25
    nothing else is the program wrong

  • @PankajSharma-tj1sn
    @PankajSharma-tj1sn 4 ปีที่แล้ว

    Sir what can we do if we have to find sum of elements above diagonal elements

  • @arunvijay2660
    @arunvijay2660 3 ปีที่แล้ว

    Can u teach right diagonal matrix

  • @piiaall
    @piiaall 6 ปีที่แล้ว

    nice explanation,,,thanks

  • @khushmeetsingh1520
    @khushmeetsingh1520 4 ปีที่แล้ว

    Hey the program isn't running......

  • @ronnygamerz88
    @ronnygamerz88 3 ปีที่แล้ว

    Sir both side left and right side sum of diagonalas ka video bana dijiye hindi me peoples wants it.

  • @jbbheda7515
    @jbbheda7515 5 ปีที่แล้ว

    Sir plz creat programs on sum of every digonal s means

  • @jatinukey4062
    @jatinukey4062 3 ปีที่แล้ว

    👍👍👍👍

  • @MuhammadUmairShaykh
    @MuhammadUmairShaykh ปีที่แล้ว

    Watching in 2023 exam tomorrow

  • @monikaverma7582
    @monikaverma7582 6 ปีที่แล้ว +2

    thank you sir , sir please upload a video for quick sort

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      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.

  • @__.Naruto__
    @__.Naruto__ 3 ปีที่แล้ว

    Ty sir👍

  • @ssk7690
    @ssk7690 6 ปีที่แล้ว +1

    When uve already taken a 3x3 matrix why to use scanf? What are you asking the user?

    • @RAKESHKUMAR-fc5lx
      @RAKESHKUMAR-fc5lx 4 ปีที่แล้ว +1

      #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

    • @ronnygamerz88
      @ronnygamerz88 3 ปีที่แล้ว

      Sir already takken size not an element.so thats y.

  • @adarshpala3424
    @adarshpala3424 6 ปีที่แล้ว +1

    Thank you very much Sir

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi Adarsh
      Thanks for your interest and support towards our channel.

  • @sandhya8276
    @sandhya8276 6 ปีที่แล้ว +1

    sir I want program for addition of matrix... plz can u help me sir..

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      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.

  • @ashishprasad1963
    @ashishprasad1963 3 ปีที่แล้ว

    Never hardcode the bounds in any loop condition. You code is not dynamic.

  • @vamsi4864
    @vamsi4864 6 ปีที่แล้ว +1

    can u please tell me how to find out sum for another diagonal in the same matrix..

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      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.

  • @mohammadzamanansari2335
    @mohammadzamanansari2335 6 ปีที่แล้ว +2

    How to calculate sum of diagonal from right dide

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi MD
      i will try to upload it.

    • @anveshkumarreddyc
      @anveshkumarreddyc 6 ปีที่แล้ว +3

      intialize any variable
      int y=0;
      Then in loop after displaying entered matrix,
      for(i=0;i

  • @Hmkm522
    @Hmkm522 7 ปีที่แล้ว +1

    sir please upload videos about pointers please sir

    • @sundeepsaradhi
      @sundeepsaradhi  7 ปีที่แล้ว

      hi manoj
      th-cam.com/video/kKKvGYAX_Zs/w-d-xo.html

  • @rohitbhardwaj2721
    @rohitbhardwaj2721 6 ปีที่แล้ว

    how to do working of this program

  • @Hmkm522
    @Hmkm522 7 ปีที่แล้ว +1

    hi sir

  • @samtech2003
    @samtech2003 2 ปีที่แล้ว

    #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