#include
#include
void main()
{
clrscr();
cout<<" Pornsuwan Sukklay \n";
cout<<" No.04 \n"; cout<<"--------------------------\n";
cout<<"Display Logic Operation:\a";
cout<<"\nLogic value of expression (3==5) :"<<(3==5);
cout<<"\nLogic value of expression (5==5) :"<<(5==5);
cout<<"\nLogic value of expression (3<=5) :"<<(3<=5);
cout<<"\nLogic value of expression (3>=5) :"<<(3>=5);
cout<<"\nLogic value of expression (3<=5)&&(5>3) :"<<(3<=5)&&(5>3);
cout<<"\nLogic value of expression (3<=5)&&(3>5) :"<<(3<=5)&&(3>5);c
out<<"\nLogic value of expression (3<=5)(3>5) :"<<(3<=5)(3>5);
cout<<"\nLogic value of expression (8<=5)(3>=5):"<<(8<=5)(3>=5);
cout<<"\n\nValue 1 is true, 0 is false...press any key"; getch(); }
โปรแกรมที่ 2
#include
#include
int A=50,B=30,C=5,D=3,E=10;
void main()
{
clrscr();
cout<<" Pornsuwan Sukklay \n";
cout<<" No.04 \n";
cout<<"--------------------------\n";
cout<<"1.1 (A+B)*(E-D) ="<<(A+B)*(E-D)<
cout<<"1.9 C*2+E*5 ="<
getch();
}
โปรแกรมที่ 3
#include
#include
int A=20,B=30,C=2,D=5,E=50;
void main()
{
clrscr();
cout<<" Pornsuwan Sukklay \n";
cout<<" No.04 \n";
cout<<"--------------------------\n";
cout<<"\n3.1 ((A>=B)&&(A==A)) ="<<((A>=B)&&(A==A));
cout<<"\n3.2 ((B+C>A+D)((B+CA+D)((B+C
cout<<"\n3.3 ((A==20)&&(B>=30)) ="<<((A==20)&&(B>=30));
cout<<"\n3.4 ((50==E)(!D<=E)) ="<<((50==E)(!D<=E));
cout<<"\n3.5 !(D!=5) ="<
cout<<"\n3.6 ((B=C+20)!=50) ="<<((B=C+20)!=50);
cout<<"\n3.7 (C==(D-3)) ="<<(C==(D-3));
cout<<"\n3.8 ((A/C<=B)&&((C+D<=A)(D>A))) ="<<((A/C<=B)&&((C+D<=A)(D>A)));
cout<<"\n3.9 ((A%C+5)==(E/5-10)) ="<<((A%C+5)==(E/5-10));
cout<<"\n3.10 (A
getch();
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น