summaryrefslogtreecommitdiff
path: root/bcc/misc/test/longtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'bcc/misc/test/longtest.c')
-rw-r--r--bcc/misc/test/longtest.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/bcc/misc/test/longtest.c b/bcc/misc/test/longtest.c
new file mode 100644
index 0000000..0c0bfe0
--- /dev/null
+++ b/bcc/misc/test/longtest.c
@@ -0,0 +1,24 @@
+int i,j;
+long m,n;
+
+main()
+{
+ while ( 1 )
+ {
+ if ( scanf( "%ld %ld", &m, &n ) <= 0 )
+ exit( 0 );
+ printf( "m = %ld n = %ld m + n = %ld m - n = %ld m * n = %ld\n",
+ m, n, m + n, m - n, m * n );
+ printf( "m = %ld n = %ld m / n = %ld m %% n = %ld\n",
+ m, n, m / n, m % n );
+ printf( "m = %ld n = %ld m&n = %ld m | n = %ld m^n = %ld\n",
+ m, n, m & n, m | n, m ^ n );
+ printf( "m = %ld n = %ld m << n = %ld m >> n = %ld\n",
+ m, n, m << (int) n, m >> (int) n );
+ printf(
+ "m = %ld n = %ld m < n is %d m == n is %d m > n is %d m == 0 is %d\n",
+ m, n, m < n, m == n, m > n, m == 0 );
+ printf( "m = %ld n = %ld -m = %ld ~m = %ld ++m = %ld --n = %ld\n",
+ m, n, -m, ~m, ++m, --n );
+ }
+}