Advertisement
machkovskitomche

matrici/lower triangular

Aug 17th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.84 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int a[3][3],red,kol,edolno;
  7.     printf("Elementite na kvadratnata matrica 3x3 se: \n");
  8.     for(red=0;red<3;red++)
  9.     {
  10.         for(kol=0;kol<3;kol++)
  11.         {
  12.             scanf("%d",&a[red][kol]);
  13.         }
  14.     }
  15.     edolno=1;
  16.         for(red=0;red<3;red++)
  17.     {
  18.         for(kol=0;kol<3;kol++)
  19.         {
  20.             if(kol>red && a[red][kol]!=0)
  21.             {
  22.                 edolno=0;
  23.             }
  24.         }
  25.     }
  26.     if(edolno==1)
  27.     {
  28.         printf("\nMatricata e dolno triagolna\n");
  29.             for(red=0;red<3;red++)
  30.     {
  31.         for(kol=0;kol<3;kol++)
  32.         {
  33.             printf("%d",a[red][kol]);
  34.         }
  35.         printf("\n\n");
  36.     }
  37.     }
  38.     else
  39.         {
  40.         printf("\nMatricata ne e dolno triagolna\n");
  41.         }
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement