Mercurial > hg > CbC > old > device
diff test/simp1.c @ 249:8313c965c0e2
*** empty log message ***
author | kono |
---|---|
date | Tue, 11 May 2004 16:50:05 +0900 |
parents | |
children | 1452eb0eab20 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/simp1.c Tue May 11 16:50:05 2004 +0900 @@ -0,0 +1,112 @@ +int +i(int a,int b,int c,int d,int f) +{ + return a+b+c+d+f; +} + +short +s(short a,short b,short c,short d,short f) +{ + return a+b+c+d+f; +} + +char +c(char a,char b,char c,char d,char f) +{ + return a+b+c+d+f; +} + + +float +f(float a,float b,float c,float d,float f) +{ + return a+b+c+d+f; +} + +double +d(double a,double b,double c,double d,double f) +{ + return a+b+c+d+f; +} + +long long +l(long long a,long long b,long long c,long long d,long long f) +{ + return a+b+c+d+f; +} + + +int +i0() +{ + int a,b,c; + a=3; + b=-3; + c=5; + c = i(a*3,b*c,b+c,b/c,b-c); + printf("int: %d\n",c); +} + +int +g() +{ + float a,b,c; + a=3.0; + b=-3.0; + c=5.0; + c = f(a*3,b*c,b+c,b/c,b-c); + printf("float: %g\n",c); +} + +int +h() +{ + double a,b,c; + a=3.0; + b=-3.0; + c=5.0; + c = d(a*3,b*c,b+c,b/c,b-c); + printf("double: %g\n",c); +} + +int +h1() +{ + long long a,b,c; + a=3; + b=-3; + c=5; + c = l(a*3,b*c,b+c,b/c,b-c); + printf("long long: %lld\n",c); +} + +int +c1() +{ + char a,b,c; + a=3; + b=-3; + c=5; + c = c(a*3,b*c,b+c,b/c,b-c); + printf("char: %d\n",c); +} + +int +s1() +{ + short a,b,c; + a=3; + b=-3; + c=5; + c = s(a*3,b*c,b+c,b/c,b-c); + printf("short: %d\n",c); +} + +main() +{ + i0(); + g(); + h(); + h1(); + return 0; +}