-
Notifications
You must be signed in to change notification settings - Fork 0
/
intest.cpp
35 lines (34 loc) · 947 Bytes
/
intest.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// inttest.cpp
// HF
//
// Created by Ally Wang on 12/10/14.
// Copyright (c) 2014 Ally Wang. All rights reserved.
//
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
// insert code here...
int i =0;
int j = 0;
i = 4/2;
cout << "4/2=" << i << endl;
i = 5/2;
cout << "5/2= "<< i << endl;
i = INT_MAX;
j = INT_MIN;
cout << "INT_MAX = " << i << endl;
cout << "INT_MIN = " << j << endl;
cout << "INT_MAX + 1 = " << i+1 <<endl;
cout << "INT_MIN - 1 = " << j-1 <<endl;
long long m = INT_MAX +1;
long long n = INT_MIN -1;
cout << "Even long long: "<< m << ", " << n << endl;
cout <<"Long long : max() = "<< numeric_limits<long long>::max() << endl;
cout << "long max()= " << numeric_limits<long >::max() <<endl;
i = 9 & 0x1;
cout <<"9 & 0x1 = " << i << endl;
j = 8 & 0x1;
cout << "8 & 0x1 = " << j << endl;
return 0;
}