fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. cout << "signed char: " << sizeof(signed char) << endl;
  6. cout << "short int: " << sizeof(short int) << endl;
  7. cout << "int: " << sizeof(int) << endl;
  8. cout << "long int: " << sizeof(long int) << endl;
  9. cout << "long long int: " << sizeof(long long int) << endl;
  10.  
  11. cout << "float: " << sizeof(float) << endl;
  12. cout << "double: " << sizeof(double) << endl;
  13. cout << "long double: " << sizeof(long double) << endl;
  14. return 0;
  15. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
signed char: 1
short int: 2
int: 4
long int: 4
long long int: 8
float: 4
double: 8
long double: 12