Advertisement
Ola_Imiolczyk

Zad1

Oct 30th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6.  
  7. {
  8.  
  9.  
  10. int a=10;
  11. char b='z';
  12. float c=3.14;
  13. double d=3.1479;
  14. bool e=true;
  15. string f="Programowanie";
  16.  
  17.  
  18.  
  19.     cout << "Zmienna typu int zajmuje: "<<sizeof (a)<<"bajty" << endl;
  20.     cout << "Zmienna typu char zajmuje: "<<sizeof (b)<<"bajty"<< endl;
  21.     cout << "Zmienna typu float zajmuje: "<<sizeof (c)<<"bajty"<< endl;
  22.     cout << "Zmienna typu double zajmuje: "<<sizeof (d)<<"bajty"<< endl;
  23.     cout << "Zmienna typu bool zajmuje: "<<sizeof (e)<<"bajty"<< endl;
  24.     cout << "Zmienna typu string zajmuje: "<<sizeof (f)<<"bajty"<< endl;
  25.   return 0;
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement