aboutsummaryrefslogtreecommitdiffstats
path: root/ee2361/Quiz2B.c
blob: 9cdcd3cc985802004c62b1d1b365daeed11bf339 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>

int is_odd(int x);  //Definition
int main() {
    printf("%d", (1 << 4) | (1 << 7));
    printf("\n");
    printf("%d", (10 & 7));
    printf("\n");
    printf("%d", is_odd(512));
    printf("\n");
    printf("%d", is_odd(1023));
    printf("\n");
}
int is_odd(int x){  //Actual Function
    return x & 1;
}