Advertisement
MateuszGgG

zad 4 b rev 0

Dec 5th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.     int k,f;
  6.     int a, b, c, d;
  7.     printf("a b c d  Funkcja\n"); // drukowanie oznaczeń tabeli
  8.     for (k = 0; k < 16; k++)
  9.     {
  10.         a = (k & 8) >> 3;
  11.         b = (k & 4) >> 2;
  12.         c = (k & 2) >> 1;
  13.         d = k & 1;
  14.         f = (!a && !b && !c) || (b && c) || (a && b);  //minimalna forma funkcji
  15.         printf("%d %d %d %d     %d \n", a, b, c, d,f); //obliczenie funkcji i wyświetlenie wiersza tabeli wynikowej
  16.             };
  17.    
  18.    
  19.     system("pause"); //zatrzymanie okna konsoli
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement