Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <limits>
- using namespace std;
- int main() {
- short s = 10;
- int i = 10;
- long l = 100;
- long long ll = 10000;
- float f = 10.00;
- double d = 10.00;
- long double ld = 10.00;
- char c = 'a';
- cout << "Size of short : " << sizeof(s) << endl;
- cout << "Size of int : " << sizeof(i) << endl;
- cout << "Size of long : " << sizeof(l) << endl;
- cout << "Size of long long : " << sizeof(ll) << endl;
- cout << "Size of float : " << sizeof(f) << endl;
- cout << "Size of double : " << sizeof(d) << endl;
- cout << "Size of long double : " << sizeof(ld) << endl;
- cout << "Size of char : " << sizeof(c) << endl;
- cout << numeric_limits<int>::max() << endl;
- cout << numeric_limits<float>::max() << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement