17 Temmuz 2014 Perşembe

Boolean Algebra Calculator V1















Kaynak .c dosyası

#include <stdio.h>

int conj(int x,int y);

int disj(int x,int y);

int not(int x);

int mate(int x,int y);

int excl(int x,int y);


int main(void)
{
    int x,y;
    printf("Enter X = ");
    scanf("%d",&x);

    printf("Enter Y = ");
    scanf("%d",&y);

    printf("\nConj X - Y     = %d\n",conj(x,y));

    printf("\nDisj X - Y     = %d\n",disj(x,y));

    printf("\nNot X          = %d\n",not(x));

    printf("\nMate X - Y     = %d\n",mate(x,y));

    printf("\nExcl X - Y     = %d",excl(x,y));

    return 0;


}

int conj(int x,int y)
    {
        if(x==1){
            if(y==1)
                return 1;
            else
                return 0;}
           else
                return 0;
    }

int disj(int x,int y)
    {
        if(x==0){
            if(y==0)
                return 0;
            else
                return 1;
        }   else
                return 1;
    }



int not(int x)
    {
        if(x==1)
            return 0;
        else
            return 1;
    }

int mate(int x,int y)
    {
       return disj(not(x),y);
    }

int excl(int x,int y)
    {
        return conj(disj(x,y),not(conj(x,y)));
    }

1 yorum:

  1. The Best Casino | OK Casino Guide - Oklahoma City
    In North America, the casino 승인전화없는 토토 꽁머니 is open for business and the 포커 스트레이트 gamblers enjoy a variety of promotions. It is located in the 바카라 town of Edgewood, 봄비 벳 Oklahoma and is open 배당사이트 daily

    YanıtlaSil