Code:
#include<stdio.h>int And(int x, int y);
int Not(int x);
int Or(int x, int y);
int multiplexer(int a, int b, int c);
int main(void)
{
int a;
int b;
int c;
printf("\nEnter Value for A: ");
scanf("%i", &a);
printf("\nEnter Value for B: ");
scanf("%i", &b);
printf("\nEnter Value for C: ");
scanf("%i", &c);
printf("\n\nValue from Multiplexer = %d", multiplexer);
system("PAUSE");
return 0;
}
int Not(int x)
{
return !x;
}
int And(int x, int y)
{
return x && y;
}
int Or(int x, int y)
{
return x || y;
}
multiplexer=Or((And(a, (Not (c)))), (And(b, c))); // Where would I put this? - And how?
// I believe this would be the correct formula