- #1
Logical Dog
- 362
- 97
Code:
#define _CRT_SECURE_NO_DEPRECATE
#include <stdio.h>
int main()
{
int A; int B;
printf("This is a simple boolean truth value calculator.\n\n");
printf("Please input the boolean value for statement A\n\n\n");
scanf("%d", &A); printf("Press enter to continue\n\n\n");
getchar();
printf("Please input the boolean value of the statement B\n\n\n");
scanf("%d", &B);
int C = A + B;
getchar();
printf("Press enter to calculate the boolean value of their disjunction\n\n\n");
getchar();
printf("A AND B: %d", A*B);
printf("A OR B: %d", C);
getchar();
printf("Press enter to exit program");
return 0;
}
I need to make the variable C to be only 0 or 1...not TWO when A and B are 1 and their disjunction gives 2.
Please use simple language as much as you can, I am very new!
thank you!: D
Last edited by a moderator: