DEV Community

Mohammed Salah
Mohammed Salah

Posted on

2 1

C++22nd Code--> (the memory size (in bytes) of each variable type using sizeof)

    #include<iostream>
    using namespace std; 
    int main()
    {
int x ; 
float y ; 
double z; 
long double l ; 
cout<<"Enter int number x : ";
cin>>x; 
cout<<endl; 
cout<<"Enter int number y : ";
cin>>y; 
cout<<endl; 
cout<<"Enter int number z : ";
cin>>z; 
cout<<endl; 
    cout<<"Enter int number l : ";
cin>>l; 
cout<<endl; 
cout<<sizeof(x)<<endl;
cout<<sizeof(y)<<endl;
cout<<sizeof(z)<<endl;
cout<<sizeof(l)<<endl;
cin.get();
return 0 ; 
    }
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay