summaryrefslogtreecommitdiff
path: root/3/5_arith_and_logic/sarl.c
diff options
context:
space:
mode:
Diffstat (limited to '3/5_arith_and_logic/sarl.c')
-rw-r--r--3/5_arith_and_logic/sarl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/3/5_arith_and_logic/sarl.c b/3/5_arith_and_logic/sarl.c
new file mode 100644
index 0000000..51e6305
--- /dev/null
+++ b/3/5_arith_and_logic/sarl.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+long shift_left4_rightn(long x, long n) {
+ x <<= 4;
+ x >>= n;
+ return x;
+}
+
+int main() {
+ printf("%d", shift_left4_rightn(15, 5));
+}