Advertisement
fabgonber

Untitled

Oct 1st, 2020 (edited)
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8.   // ints
  9.   int i1 = 1;
  10.   cout << "i1 = " << i1 << endl;
  11.   int i2;
  12.   i2 = 2;
  13.   cout << "i2 = " << i2 << endl;
  14.   int i3(3);
  15.   cout << "i3 = " << i3 << endl;
  16.   int i4{ 4 };
  17.   cout << "i4 = " << i4 << endl;
  18.  
  19.   //doubles
  20.   double d1 = 3.3;
  21.   double d2 = 11;
  22.  
  23.   //chars
  24.   char c1 = 'a';
  25.   cout << "ci = " << c1 << endl;
  26.  
  27.   bool flag = false;
  28.  
  29.   auto a1 = 1; //int
  30.   auto a2 = 3.3; //double
  31.   auto a3 = 'c';  //char
  32.   auto a4 = "hello";  //c*
  33.   auto a5 = true;  //bol
  34.   auto a6 = 3L; //Long
  35.   auto a7 = 1'000'000'000'000; //Long Long
  36.   auto a8 = 0xFF; //int (255) hex literal
  37.   auto a9 = 0b111; //int (7) binary literal
  38.  
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement