Advertisement
DominikPasiut

Untitled

Nov 9th, 2018
112
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.  
  3. int main()
  4. {
  5.  
  6.    printf("Aby wybrac program nacisnij odpowiedni klawisz: \n\n");
  7.  
  8.    int program;
  9.    int tab[4][4], i, j;
  10.  
  11.  
  12.    printf("1. Wyswietlenie macierzy 4x4 z podanych liczb.\n2. Dodanie dwoch macierzy z podanych liczb.\n3. mnozenie dwoch macierzy z podanych liczb.\n4. Zakoncz");
  13.  
  14.    printf("\nTu wpisz numer: ");
  15.    scanf("%d", &program);
  16.  
  17.  
  18.    switch (program)
  19.    {
  20.    case 1:
  21.        for(i=0; i<4; i++)
  22.        {
  23.            for(j=0; j<4; j++)
  24.            {
  25.                printf("Podaj liczbe %d.%d: ", i, j);
  26.                scanf("%d", &tab[i][j]);
  27.            }
  28.        }
  29.        
  30.        break;
  31.    case 2:
  32.        printf("2");
  33.        break;
  34.    case 3:
  35.        printf("3");
  36.        break;
  37.    case 4:
  38.        return 0;
  39.    default:
  40.        printf("wybierz jeden z programow");
  41.    }
  42.  
  43.  
  44.  
  45.     return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement