Hi guys, I have problem with this: I need program A,B,C,D:
that when I write 4 numbers program solve
truth (1)/false (0) I have "formula" ¬(A ∨ B) ∧ ¬C ∧ (C ∨ D)
I have program, but i can write whatever and everytime program write 0 (False). I am beginner in programming. Can you help me?
I have two version:
Code:
int main()
{
printf("A,B,C,D:\n");
int a,b,c,d;
int first = (!(a||b));
int second = (!(c));
int third = (c||d);
scanf("%d,%d,%d,%d",&a,&b,&c,&d);
printf("%d",(!(a||b))&&(!(c))&&(c||d));
return 0;
}
OR
Code:
int main()
{
printf("A,B,C,D:\n");
int a,b,c,d;
scanf("%d,%d,%d,%d",&a,&b,&c,&d);
result =((((!(a||b))&&(!(c))&&(c||d));
printf("%d",result);
return 0;
}