#include<stdio.h> typedef int Bool; #define TRUE 1 #define FALSE 0 Bool and(int x,int y) { if(x!=0) { if(y!=0) return TRUE; else return FALSE; } else { if(y!=0) return FALSE; else return FALSE; } } Bool or(int x,int y) { if(x==0) { if(y==0) return FALSE; else return TRUE; } else { if(y==0) return TRUE; else return TRUE; } } Bool not(int x) { if(x==0) return TRUE; else return FALSE; } Bool equiv(int x,int y) { if(x==y) return TRUE; else return FALSE; } void main() { int m=1,n=3; Bool ma,mb,mc,md; ma=and(m,n); mb=or(m,n); mc=not(m); md=equiv(m,n); printf("1——TRUE/0——FALSE/n"); printf("%d %d %d %d",ma,mb,mc,md); getch(); }