$B!!$=$l$G$O!"0J2<$N(IX=D(J2.2 $B$NDL$j$K%W%m%0%i%`$rF~NO!"J]B8!"%3%s%Q%$%k$7$F
(IX=D(J2.2 $B=q<0;XDjF~NO(J -----------------------------------------------------------------------
#include
main()
{
int a, b, c; /* int$B7?$NJQ?t(J a, b, c $B$N@k8@(J */
scanf("%d", &a); /* $B%-!<%\!<%I$+$i(J a $B$KF~NO(J */
scanf("%d", &b); /* $B%-!<%\!<%I$+$i(J b $B$KF~NO(J */
c = a - b; /* a $B$+$i(J b $B$r0z$$$?7k2L$r(J c $B$KBeF~(J */
printf("%d - %d = %d\n", a, b, c); /* a, b, c $B$NFbMF$r=PNO$7$F2~9T(J */
}
(IX=D(J2.3 $B#2$D$N?t$N;MB'7W;;(J -----------------------------------------------------------------
#include
main()
{
float a = 2.0, b = 3.0, c; /* float$B7?$NJQ?t(J a, b, c $B$N@k8@(J */
c = a + b; /* $B2C;;(J */
printf("%f + %f = %f\n", a, b, c); /* c $B$NFbMF$r=PNO$7$F2~9T(J */
c = a - b; /* $B8:;;(J */
printf("%f - %f = %f\n", a, b, c); /* c $B$NFbMF$r=PNO$7$F2~9T(J */
c = a * b; /* $B>h;;(J */
printf("%f * %f = %f\n", a, b, c); /* c $B$NFbMF$r=PNO$7$F2~9T(J */
c = a / b; /* $B=|;;(J */
printf("%f / %f = %f\n", a, b, c); /* c $B$NFbMF$r=PNO$7$F2~9T(J */
}
$B$*$^$1!!NcJ8#4(J $B$$$m$$$m$J?tCM$N%W%j%s%H(J ----------------------------------------------------
/* varip.c */
#include
#define ALPHA 65 // ALPHA $B$r?tCM$KF~$lBX$($k(J
main()
{
int ch;
ch = ALPHA;
/* $BJQ?t(J ch $B$NCM$r!!J8;z!!(J10$B?J?t!!#8?J?t!!(J16$B?J?t!!(J10$B?J?t@dBPCM$G=PNO(J */$B!!(J
printf("%c = %d = 0%o = 0x%x, %u", ch, ch, ch, ch, -ch);
}
$B!!#C$N%W%m%0%i%`$K$O!"B?$/$N%W%m%0%i%_%s%08@8l$HF1MM$N;;=Q1i;;;R$N$[$+$K!"(J
$B#CFHFC$N1i;;;R$H$7$FBeF~1i;;;R!"%$%s%/%j%a%s%H!&%G%/%j%a%s%H1i;;;R!"(J
$B%-%c%9%H!J7?JQ49!K1i;;;R$,$"$j$^$9!#(J
$B!!(IX=D(J2.4 $B$G$O%$%s%/%j%a%s%H!&%G%/%j%a%s%H1i;;;R$r;H$C$?%W%m%0%i%`!"(J
(IX=D(J2.5 $B$G$O%-%c%9%H!J7?JQ49!K1i;;;R$r;H$C$?%W%m%0%i%`$NNc$G$9!#(J
$B@0?tF1;N$N3d$j;;$G$O!"7W;;7k2L$O@0?t$K4]$a$i$l$F$7$^$$$^$9$N$G!"(J
$B%-%c%9%H1i;;;R$r;H$C$F@0?t$r
$B!|!!%G!<%?7?$NJQ49(J
$B!Z=q<0![(J$B!!!!(J($B%G!<%?7?(J) $B<0(J
$B!!!!!!!!!!!!(J( float ) intA
(IX=D(J2.4 $B#1$r2C$($k7W;;(J ---------------------------------------------------------------------
#include
main()
{
int a, b, c; /* int$B7?$NJQ?t(J a, b, c $B$N@k8@(J */
a = 12; /* 12 $B$r(J a $B$KBeF~(J */
b = ++a; /* a $B$K(J 1 $B$r2C$($?CM$r(J b $B$KBeF~(J */
c = a++; /* a $B$NCM$r(J c $B$KBeF~8e(J a $B$K(J 1 $B2C$($k(J */
printf("%d, %d, %d\n", a, b, c); /* a, b, c $B$NFbMF$r=PNO$7$F2~9T(J */
}
(IX=D(J2.5 $B7?JQ491i;;;R$r;H$C$?:.9g7W;;(J -------------------------------------------------------
#include
main()
{
float a, b, f = 40; /* float$B7?$NJQ?t(J a,b,f $B$r@k8@$7!$(Jf $B$K(J40$B$rBeF~(J */
a = (5 / 8) * (f - 32); /* (5/8)*(f-32)$B$r7W;;$7!$(Ja $B$KBeF~(J */
b = ((float)5 / (float)8) * (f - 32); /* (5.0/8.0)*(f-32)$B$r7W;;$7!$(Jb $B$KBeF~(J */
printf("a = %f\n", a); /* a $B$NFbMF$r=PNO$7$F2~9T(J */
printf("b = %f\n", b); /* b $B$NFbMF$r=PNO$7$F2~9T(J */
}
$BI=(J2_7 $B;;=Q1i;;;R(J
$B1i;;;R(J |
$B1i;;(J |
$B=q<0(J |
$B0UL#(J |
$B!\(J |
$B2C;;(J |
a + b |
a $B$K(J b $B$r2C$($k(J |
$B!](J |
$B8:;:(J |
a - b |
a $B$+$i(J b $B$r0z$/(J |
* |
$B>h;;(J |
a * b |
a $B$K(J b $B$r3]$1$k(J |
/ |
$B=|;;(J |
a / b |
a $B$r(J b $B$G3d$k(J |
% |
$B>jM>;;(J |
a % b |
a $B$r(J b $B$G3d$C$?M>$j$r5a$a$k(J |
$BI=(J2_8 $BBeF~1i;;;R(J
$B1i;;;R(J |
$B1i;;(J |
$B=q<0(J |
$B0UL#(J |
= |
$BBeF~(J |
a = b |
a = b |
$B!\(J= |
$B2C;;$HBeF~(J |
a += b |
a = a + b |
$B!](J= |
$B8:;:$HBeF~(J |
a -= b |
a = a - b |
*= |
$B>h;;$HBeF~(J |
a *= b |
a = a * b |
/= |
$B=|;;$HBeF~(J |
a /= b |
a = a / b |
%= |
$B>jM>;;$HBeF~(J |
a %= b |
a = a % b |
|