Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b,c;
- short d = 10.5;
- cout << "a : " << a << endl << "b : " << b << endl << "c : " << c << endl;
- cout << "a : " << &a << endl << "b : " << &b << endl << "c : " << &c << endl;
- cout << d << endl;
- float f = 10.456666666666; // 4 bytes upto 38 zeroes
- double dd = 10.45555555555555555555; // 8 bytes upto 308 zeroes
- cout << f << endl;
- cout << dd << endl;
- char t = 'a';
- cout << t << endl;
- string str1 = "Hello world!\n";
- string str2 = "Welcome";
- cout << str1 + str2 << endl;
- // boolean types true or false
- bool boolean = true; // 1 - true, 0 - false
- cout << boolean << endl;
- // for unsigned short int
- unsigned short us = 65535;
- cout << us << endl;
- // constants
- const int con = 100;
- cout << con << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment