常见的几个运算符号测试程序
大小:0.1 MB 人气: 2017-09-06 需要积分:0
常见的几个运算符号测试程序
main(){ int A, B, C, D, E, x, y;
x=7;
y=2;
A=x+y;
B=x-y;
C=x*y;
D=x/y;
E=x%y;
} //模拟时,游标放在此,再按运行至游标按钮
--------------------------------------
main()
{ unsigned char A, B, C, D, E, F, x, y;
x=7;
y=2;
A=(x==y);
B=(x!=y);
C=(x>y);
D=(x
F=(x<=y);
} //模拟时,游标放在此,再按运行至游标钮
----------------------------------------------------
main()
{ unsigned char A, B, C, x, y, z;
x=7;
y=2;
z=5;
A=(x>y)&&(y
C=!(x>z);
} //模拟时,游标放在此,再按运行至游标钮
--------------------------------------------------
main()
{ char A, B, C, D, E, F, x, y;
char a1, a2, a3, a4, a5, a6;
x=0x25; /* 00100101 */
y=0x73; /* 01110011 */
A=x&y;
B=x|y;
C=x^y;
D=~x;
E=x<<3;
F=x>>4;
a1=A;a2=B,a3=C,a4=D,a5=E,a6=F; //辅助观察运算状况
} //模拟时,游标放在此,再按运行至游标钮
---------------------------------
main()
{ unsigned char A=0x52, B=0x3a, C=0x01, D=0x01,
E=0xaa, F=0x11, G=0xf0, H=0x1f,
I=0x55, J=0x68, K=0x75, x=0x96;
unsigned char a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11;
A=x; // A=x=0x96
B+=x; // B=B+x=0x3a+0x96=0xd0
C-=x; // C=C-x=0x01-0x96=0x6b
D*=x; // D=D*x=0x15*0x96
E/=x; // E=E/x=0xaa/0x96=0x01
F%=x; // F=F%x=0x11%0x96=0x11
G&=x; // G=G&x=0xf0&0x96=0x90
H|=x; // H=H|x=0x1f/0x96=0x9f
I^=x; // I=I^x=0x55^0x96=0xc3
J<<=2; // J=J<<2=0xa0
K>>=3; // K=K>>3=0x0e
a1=A;a2=B;a3=C;a4=D;a5=E;a6=F; //辅助观察运算状况
a7=G;a8=H;a9=I;a10=J;a11=K;//辅助观察运算状况
} //模拟时,游标放在此,再按运行至游标钮
----------------------------------------------
main()
{ char x=5,y=10;
x++; // x=x+1
y--; // y=y-1
} //模拟时,游标放在此,再按运行至游标钮
非常好我支持^.^
(0) 0%
不好我反对
(0) 0%