Computer Science, asked by justenjoy210, 7 months ago

Maya is interested to learn programming languages. When she is learning, she had a doubt on how to find the size of the variable. In C++, we have the sizeof() operator, which is used to get the size occupied by a variable or value. Now, write a C++ program to declare a variable of character, integer, float, and double type and print their respective sizes.

Answers

Answered by syed2020ashaels
0

The data given in the question is In C++, we have the sizeof() operator, which is used to get the size occupied by a variable or value.

Here, we have to write the,c++ program to declare the variable of the character, integer, float and double and to print their sizes.

The c++ is a programming language used to create computer programs and it was the one of the language used in game development

let us write a c++ program as follows:

using namespace std;

int main()

{

cout<<" Size of char :"<<Size of (char) <<"byte"<<endl;

cout <<"Size of int:"<<Size of (int) <<"bytes"<<endl;

cout<<"Size of float:"<<Size of (float) <<"bytes"<<endl;

cout<<"Size of double:"<<Size of (double) <<"bytes"<<endl;

return(0) ;

}

# spj2

we can find the similar questions through the link

https://brainly.in/question/45090549?referrer=searchResults

Answered by pranavnn2010
0

Answer:

The data given in the question is In C++, we have the sizeof() operator, which is used to get the size occupied by a variable or value.

Here, we have to write the,c++ program to declare the variable of the character, integer, float and double and to print their sizes.

The c++ is a programming language used to create computer programs and it was the one of the language used in game development

let us write a c++ program as follows:

using namespace std;

int main()

{

cout<<" Size of char :"<<Size of (char) <<"byte"<<endl;

cout <<"Size of int:"<<Size of (int) <<"bytes"<<endl;

cout<<"Size of float:"<<Size of (float) <<"bytes"<<endl;

cout<<"Size of double:"<<Size of (double) <<"bytes"<<endl;

return(0) ;

}

Similar questions