Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help with the following assignment problem.Program should be in C++ .Your

ID: 3681041 • Letter: I

Question

I need help with the following assignment problem.Program should be in C++.Your help will be very much appreciated.

Write a program that uses the sizeof operator to determine the sizes in bytes of the various data types on your computersystem. The program shouldtakea single command line argument. The argument should be the name of a text file "datasize.dat". In your program, first you need toopen datasize.dat for writing, and then write the size of various data typesonto this file.The format for the results in the file shouldbe as follows:

Size 1 1 2 Data type char unsigned char short int unsigned short int int unsigned int long int unsigned long int float double long double 4 4 4 4 4 8 16

Explanation / Answer

void main() { printf(" Udemy.com - Calculating the Size of Data Types in C using Sizeof "); printf("Char: %u ", sizeof(char)); printf("Unsigned Char: %u ", sizeof(unsigned char)); printf("Short int: %u ", sizeof(short int)); printf("Int: %u ", sizeof(int)); printf("unsigned int: %u ", sizeof(unsigned int)); printf("Unsigned Long int: %u ", sizeof(unsigned long long)); printf("Float: %u ", sizeof(float)); printf("Double: %u ", sizeof(double)); printf("Long Double: %u ", sizeof(long double)); }