Advertisement
avr39ripe

BR012typeConvPractice

Jan 13th, 2021
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5.     int a{ 10 };
  6.     int b{ 3 };
  7.     int c{ 1 };
  8.  
  9.     float aF{ 10 };
  10.     float bF{ 3 };
  11.     int tempI{ 0 };
  12.  
  13.  
  14.     float temp{ 67.45678 };
  15.     const double Pi{ 3.1415 };
  16.     bool flag{ true };
  17.     char symb{ 'A' };
  18.  
  19.     temp = (float)(a / b);
  20.     tempI = aF / bF;
  21.  
  22.  
  23.     flag = symb;
  24.  
  25.     // false = > 0, 0.0 '\0'; true - > rest;
  26.     // false -> 0, 0.0, '\0'; true -> 1, 1.0, '\1';
  27.  
  28.  
  29. //  std::cout << "c = " << c << '\n';
  30.     std::cout << "temp = " << temp << '\n';
  31. //  std::cout << "symb = " << symb << '\n';
  32. //  std::cout << std::boolalpha << "flag = " << flag << '\n';
  33.  
  34. //  c = ((((a * b) + temp) * flag) + symb);
  35.  
  36. //  std::cout << "c = " << c << '\n';
  37.     // (a*b)= 6(int)
  38.     // ((a*b)+temp) = 73.45678(float)
  39.     // (((a*b)+temp) * flag) => 73.45678(float)
  40.     // ((((a * b) + temp) * flag) + symb) = 138.45678(float)
  41.     // c = ((((a * b) + temp) * flag) + symb)
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement