Answer to Question #249345 in C++ for Asjad

Question #249345


  • There are several data types in C++ namely built-in data types and enumerated datatypes and class types. Now you have to write a C++ program that reads the file compiled using C++ compiler successfully. The output of the file must display in tabular column the name of the data type and how many times it is used in program. that means how many integers are declared, how many classes declared and instantiated etc.




1
Expert's answer
2021-10-11T00:05:39-0400
#include <iostream>
using namespace std;


int main()
{
    double d;
	char c;
	int i;
	float f;
	cout << "Size of double is: " <<
	sizeof(d) <<"\n";
	cout << "Size of char is: " <<
	sizeof(c) <<"\n";
	cout << "Size of int is: " <<
	sizeof(i) <<"\n";
	cout << "Size of float is: " <<
	sizeof(f) <<"\n";
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS