Guest User

Untitled

a guest
Mar 28th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int main()
  5. {
  6. int a,b,c;
  7.  
  8. short d = 10.5;
  9.  
  10. cout << "a : " << a << endl << "b : " << b << endl << "c : " << c << endl;
  11. cout << "a : " << &a << endl << "b : " << &b << endl << "c : " << &c << endl;
  12.  
  13. cout << d << endl;
  14.  
  15. float f = 10.456666666666; // 4 bytes upto 38 zeroes
  16. double dd = 10.45555555555555555555; // 8 bytes upto 308 zeroes
  17.  
  18.  
  19. cout << f << endl;
  20. cout << dd << endl;
  21.  
  22. char t = 'a';
  23.  
  24. cout << t << endl;
  25.  
  26. string str1 = "Hello world!\n";
  27. string str2 = "Welcome";
  28.  
  29. cout << str1 + str2 << endl;
  30.  
  31. // boolean types true or false
  32. bool boolean = true; // 1 - true, 0 - false
  33.  
  34. cout << boolean << endl;
  35.  
  36.  
  37. // for unsigned short int
  38. unsigned short us = 65535;
  39.  
  40. cout << us << endl;
  41.  
  42.  
  43. // constants
  44. const int con = 100;
  45.  
  46. cout << con << endl;
  47.  
  48. return 0;
  49. }
Add Comment
Please, Sign In to add comment