#include using namespace std; int main(){ // declare a variable int a = 600; // Allocates 4 bytes on the stack cout << "a = " << a << "\n"; cout << "a has a size of " << sizeof(a) << " bytes\n"; short b = 6700; cout << "b = " << b << "\n"; cout << "b has a size of " << sizeof(b) << " bytes\n"; a = 4000000000; cout << "a = " << a << "\n"; // Doesn't work because a is too big a = 50000; b = a; // a and b should be the same, right? cout << "a = " << a << " b = " << b << "\n"; b = -1; cout << "b = " << b << "\n"; char c = 100; cout << "c = " << c << "\n"; b = 'S'; // single quotes are a character, double quotes are a string cout << "b = " << b << "\n"; b = 1.5; cout << "b = " << b << "\n"; float d = 1.5; cout << "d = " << d << "\n"; double e = 3.141592653; cout.precision(15); cout << "e = " << e << "\n"; d = e; cout << "d = " << d << "\n"; cout << "sizeof(d) = " << sizeof(d) << " sizeof(e) = " << sizeof(e) << "\n"; return 0; }