CPP
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
#include <iostream>
#include <cstdio>
//using <limits> library for numeric_limits, min() & max() function
#include <limits>
int main() {
puts("How to Find Maximum Range \nfor Every Data Type using Limits Library\n");
puts("numeric_limits<Data Type you choose>::min() or max()\n");
puts("Example:");
std::cout<< "signed short\nmin: "<<std::numeric_limits<signed short>::min();
std::cout<< "\nmax: +"<<std::numeric_limits<signed short>::max()<<std::endl;
std::cout<< "\nunsigned short:\nmin: "<<std::numeric_limits<unsigned short>::min();
std::cout<< "\nmax: +"<<std::numeric_limits<unsigned short>::max()<<std::endl;
std::cout<< "\nsigned int:\nmin: "<<std::numeric_limits<signed int>::min();
std::cout<< "\nmax: +"<<std::numeric_limits<signed int>::max()<<std::endl;
std::cout<< "\nunsigned int:\nmin: "<<std::numeric_limits<unsigned int>::min();
std::cout<< "\nmax: +"<<std::numeric_limits<unsigned int>::max()<<std::endl;
std::cout<< "\nsigned long:\nmin: "<<std::numeric_limits<signed long>::min();
std::cout<< "\nmax: +"<<std::numeric_limits<signed long>::max()<<std::endl;
std::cout<< "\nint:\nmin: "<<std::numeric_limits<int>::min();
std::cout<< "\nmax: +"<<std::numeric_limits<int>::max()<<std::endl;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run