C++ Program To Display Size Of Different Datatype on Command Line

Can I teach the prospects to execute the C++ Program To Display Size Of Different Datatype on Command Line successfully using this article? Come on! Let’s start the article.

C++ Program To Display Size Of Different Datatype on Command Line

C++ Program To Display Size Of Different Datatype on Command Line

Source Code

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
 cout<<"size of int "<<sizeof(int)<<endl;
 cout<<"size of float "<<sizeof(float)<<endl;
 cout<<"size of double "<<sizeof(double)<<endl;
 cout<<"size of long "<<sizeof(long)<<endl;
 cout<<"size of long double "<<sizeof(long double)<<endl;
 cout<<"size of long long int "<<sizeof(long long int)<<endl;
 cout<<"size of long long "<<sizeof(long long)<<endl;


}

Conclusion

We hope this article will help you to Display Size Of Different Datatype on Command Line using C++ Program. Please contact us through the comment section if you want to rectify your problems regarding the concept. Share this tutorial with other C/C++ learners.

Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment