วันอังคารที่ 20 ตุลาคม พ.ศ. 2552

ผลงานสัปดาห์ที่ 2

โปรแกรมที่ 1
#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.2 ++D+C*E ="<<++D+C*E<
cout<<"1.3 (25+A)/C+B ="<<(25+A)/C+B<
cout<<"1.4 (A*=D) ="<<(A*=D)<
cout<<"1.5 20*C+B+++D/2 ="<<20*c+b+++d/2<
cout<<"1.6 --D+C+B-- ="<<--D+C+B--<
cout<<"1.7 25*D/5+10 ="<<25*d/5+10<
cout<<"1.8 A+B--+D ="<
cout<<"1.9 C*2+E*5 ="<
cout<<"1.10 (A*2)+B/C-15="<<(A*2)+B/C-15<
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();
}


ไม่มีความคิดเห็น:

แสดงความคิดเห็น