Advertisement
rikardoricz

zad1 Tomasz Świątek 3bTI/2

Oct 27th, 2020 (edited)
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     char znak = 'd';
  8.     int calkowita = 12;
  9.     float zmiennopozycyjna = 27.5f;
  10.     double podwojnaprecyzja = 24;
  11.     bool onlyTrue = true;
  12.     string Napis = "Tomasz";
  13.  
  14.     cout << "Zmienna typu bool zajmuje: " << sizeof(znak)<<" bajty" << endl;
  15.     cout << "Zmienna typu int zajmuje: " << sizeof(calkowita)<<" bajty" << endl;
  16.     cout << "Zmienna typu float zajmuje: " << sizeof(zmiennopozycyjna)<<" bajty" << endl;
  17.     cout << "Zmienna typu double zajmuje: " << sizeof(podwojnaprecyzja)<<" bajty" << endl;
  18.     cout << "Zmienna typu bool zajmuje: " << sizeof(onlyTrue)<<" bajty" << endl;
  19.     cout << "Zmienna typu string zajmuje: " << sizeof(Napis)<<" bajty" << endl;
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement