-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathops.c
More file actions
24 lines (20 loc) · 768 Bytes
/
Copy pathops.c
File metadata and controls
24 lines (20 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//Author: Emmanuel Akinrintoyo
//Date: 26/09/2018
#include <stdio.h>
int main(void) {
printf("5 + 4 = %d\n", 5 + 4); //Addition
printf("5 - 4 = %d\n", 5 - 4); //Sub
printf("5 * 4 = %d\n", 5 * 4); //Mulitply
printf("(float)5 / (float)4 = %f\n",(float)5 / (float)4);
printf("5 / 4 = %d\n",5 / 4);
printf("5 % 4 = %d\n",5 % 4);//MODULO
printf("5 & 4 = %d\n",5 & 4);//BITWISE AND
printf("5 | 4 = %d\n",5 | 4);//BITWISE OR
printf("5 ^ 4 = %d\n",5 ^ 4);//BITWISE XOR
printf("~5 = (hex) %x\n", ~5);//BITWISE COMPLEMENT OR BITWISE NOT
printf("Quiz1 %d\n", 0x1389 & 0x2821);
printf("Quiz2 %d\n", ~0x8378);
printf("Quiz3 %d\n", 1234 | 5678);
printf("Quiz4 %d\n", 0xa5a5 ^ 0xffff);
printf("Quiz5 %d\n", 128 % 11);
}