-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintTypes.cpp
57 lines (51 loc) · 2.37 KB
/
intTypes.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
using namespace std;
#include <climits>
int main()
{
cout<<"The short and int sizes demonstrated" << endl;
/*******************************/
short shrtMax = SHRT_MAX;
short shrtMin = SHRT_MIN;
int intMin = INT_MIN;
int intMax = INT_MAX;
long long longMin = LLONG_MIN;
long long longMax = LLONG_MAX;
unsigned short usShrtMax = USHRT_MAX;
unsigned int usIntMax = UINT_MAX;
unsigned long usLongMax = ULONG_MAX;
/*********************/
cout << "The min of short integer is: " << shrtMin<<endl;
cout << "The min of short integer is: " << shrtMax<<endl;
cout<< "The size of short integer: " << sizeof(short) << " Bytes " << endl;
cout <<"*****************"<<endl;
/*******************/
cout << "The min of integer is: " << intMin << endl;
cout << "The max of integer is: " << intMax <<endl;
cout<< "The size of short integer: " << sizeof(int) << " Bytes " << endl;
cout <<"*****************"<<endl;
/***********************/
cout << "The min of long long integer is: " << longMin << endl;
cout << "The min of long long integer is: " << longMax <<endl;
cout<< "The size of long long integer: " << sizeof(long long) << " Bytes " << endl;
cout <<"*****************"<<endl;
/***********************/
cout << "The Max of Unsigned short integer is: " << usShrtMax <<endl;
cout<< "The size of Unsinged short integer: " << sizeof(unsigned short) << " Bytes " << endl;
cout <<"*****************"<<endl;
/*********************/
cout << "The Max of Unsigned int integer is: " << usIntMax <<endl;
cout<< "The size of Unsinged int integer: " << sizeof(unsigned int) << " Bytes " << endl;
cout <<"*****************"<<endl;
/*********************/
cout << "The Max of Unsigned long integer is: " << usLongMax <<endl;
cout<< "The size of Unsinged long integer: " << sizeof(unsigned long) << " Bytes " << endl;
cout <<"*****************"<<endl;
return 0;
}