1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #include<iostream> using namespace std; int main() { char charType; short shortType; int intType; long longType; float floatType; double doubleType; // Sizeof operator is used to evaluate the size of a declared data type cout << "Size of char: " << sizeof(charType) <<" byte" << endl; cout<<"Size of Short: " << sizeof(shortType) <<" bytes" << endl; cout<<"Size of int: " << sizeof(intType) <<" bytes" << endl; cout<<"Size of long: " << sizeof(longType) <<" bytes" << endl; cout<<"Size of float: " << sizeof(floatType) <<" bytes" << endl; cout<<"Size of double: " << sizeof(doubleType) <<" bytes" << endl; return 0;; } |
03 March 2019 2121 Written By: Rohit Mhatre
© 2020 Tech Study. All rights reserved | Developed by Tech Study| Privacy Policy | Sitemap