SlideShare a Scribd company logo
1 of 1
Download to read offline
Create a procedural C++ program called datatype_sizes.cc that will output the sizes in bytes of
the datatypes long int, float, double and float *. Make your program simple and and its logic
straightforward. For example, the program logic can consist solely of four printf() statements. .
With the exception of warnings about parameters argc and argv of function main() not being
used, your program must compile without errors or warnings when the -Wall and -Wextra
options are given to the C++ compiler. Hint: use the C/C++ function sizeof(). The return type of
sizeof() is size_t. To have printf(3) output a value of type size_t, use the “%zu” or “%zd” format
specification.
Note: overly and unnecessarily complex programs may be docked marks.
Solution
#include
int main() {
printf("Size of long int = %zu ",sizeof(long int));
printf("Size of float = %zu ",sizeof(float));
printf("Size of double = %zu ",sizeof(double));
printf("Size of float* = %zu ",sizeof(float *));
}
/* sample output
*/

More Related Content

Similar to Create a procedural C++ program called datatype_sizes.cc that will o.pdf

Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures Pradipta Mishra
 
2. Data, Operators, IO.ppt
2. Data, Operators, IO.ppt2. Data, Operators, IO.ppt
2. Data, Operators, IO.pptswateerawat06
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2Don Dooley
 
1. introduction to computer
1. introduction to computer1. introduction to computer
1. introduction to computerShankar Gangaju
 
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...RSathyaPriyaCSEKIOT
 
basics of C and c++ by eteaching
basics of C and c++ by eteachingbasics of C and c++ by eteaching
basics of C and c++ by eteachingeteaching
 
2. Data, Operators, IO (5).ppt
2. Data, Operators, IO (5).ppt2. Data, Operators, IO (5).ppt
2. Data, Operators, IO (5).pptElisée Ndjabu
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILEDipta Saha
 
C LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDYC LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDYRajeshkumar Reddy
 
Core programming in c
Core programming in cCore programming in c
Core programming in cRahul Pandit
 

Similar to Create a procedural C++ program called datatype_sizes.cc that will o.pdf (20)

comp2
comp2comp2
comp2
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures
 
c++ referesher 1.pdf
c++ referesher 1.pdfc++ referesher 1.pdf
c++ referesher 1.pdf
 
C language
C languageC language
C language
 
2. Data, Operators, IO.ppt
2. Data, Operators, IO.ppt2. Data, Operators, IO.ppt
2. Data, Operators, IO.ppt
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2
 
The basics of c programming
The basics of c programmingThe basics of c programming
The basics of c programming
 
1. introduction to computer
1. introduction to computer1. introduction to computer
1. introduction to computer
 
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
 
2. data, operators, io
2. data, operators, io2. data, operators, io
2. data, operators, io
 
basics of C and c++ by eteaching
basics of C and c++ by eteachingbasics of C and c++ by eteaching
basics of C and c++ by eteaching
 
2. Data, Operators, IO (5).ppt
2. Data, Operators, IO (5).ppt2. Data, Operators, IO (5).ppt
2. Data, Operators, IO (5).ppt
 
AS TASKS #8
AS TASKS #8AS TASKS #8
AS TASKS #8
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
 
Matlab Basic Tutorial
Matlab Basic TutorialMatlab Basic Tutorial
Matlab Basic Tutorial
 
C LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDYC LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDY
 
C programming
C programmingC programming
C programming
 
C tutorials
C tutorialsC tutorials
C tutorials
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
Core programming in c
Core programming in cCore programming in c
Core programming in c
 

More from neerajsachdeva33

Can you please explain those risk management from Kaiser Permanente.pdf
Can you please explain those risk management from Kaiser Permanente.pdfCan you please explain those risk management from Kaiser Permanente.pdf
Can you please explain those risk management from Kaiser Permanente.pdfneerajsachdeva33
 
A survey of 2630 musicians showed that 372 of them are left-handed. .pdf
A survey of 2630 musicians showed that 372 of them are left-handed. .pdfA survey of 2630 musicians showed that 372 of them are left-handed. .pdf
A survey of 2630 musicians showed that 372 of them are left-handed. .pdfneerajsachdeva33
 
What is other disorder of arteries beside atherosclerosis What.pdf
What is other disorder of arteries beside atherosclerosis What.pdfWhat is other disorder of arteries beside atherosclerosis What.pdf
What is other disorder of arteries beside atherosclerosis What.pdfneerajsachdeva33
 
Why is a egg cell is much larger than a sperm cell Explain in 1-2 p.pdf
Why is a egg cell is much larger than a sperm cell Explain in 1-2 p.pdfWhy is a egg cell is much larger than a sperm cell Explain in 1-2 p.pdf
Why is a egg cell is much larger than a sperm cell Explain in 1-2 p.pdfneerajsachdeva33
 
What type of relationship typically exists between the resident and t.pdf
What type of relationship typically exists between the resident and t.pdfWhat type of relationship typically exists between the resident and t.pdf
What type of relationship typically exists between the resident and t.pdfneerajsachdeva33
 
What is the model for floral induction by day-lengthSolutionB.pdf
What is the model for floral induction by day-lengthSolutionB.pdfWhat is the model for floral induction by day-lengthSolutionB.pdf
What is the model for floral induction by day-lengthSolutionB.pdfneerajsachdeva33
 
What is the difference between a semi-permeable and selectively perm.pdf
What is the difference between a semi-permeable and selectively perm.pdfWhat is the difference between a semi-permeable and selectively perm.pdf
What is the difference between a semi-permeable and selectively perm.pdfneerajsachdeva33
 
what did Linnaeus contribute to taxonomySolutionThe classifica.pdf
what did Linnaeus contribute to taxonomySolutionThe classifica.pdfwhat did Linnaeus contribute to taxonomySolutionThe classifica.pdf
what did Linnaeus contribute to taxonomySolutionThe classifica.pdfneerajsachdeva33
 
We are interested in whether the proportions of female suicide victim.pdf
We are interested in whether the proportions of female suicide victim.pdfWe are interested in whether the proportions of female suicide victim.pdf
We are interested in whether the proportions of female suicide victim.pdfneerajsachdeva33
 
True or false Fruits attract animals that act as pollinators T.pdf
True or false Fruits attract animals that act as pollinators T.pdfTrue or false Fruits attract animals that act as pollinators T.pdf
True or false Fruits attract animals that act as pollinators T.pdfneerajsachdeva33
 
the observed locations of integrated retroviral proviruses within ho.pdf
the observed locations of integrated retroviral proviruses within ho.pdfthe observed locations of integrated retroviral proviruses within ho.pdf
the observed locations of integrated retroviral proviruses within ho.pdfneerajsachdeva33
 
The general name for something that binds to a protein is Select one.pdf
The general name for something that binds to a protein is  Select one.pdfThe general name for something that binds to a protein is  Select one.pdf
The general name for something that binds to a protein is Select one.pdfneerajsachdeva33
 
serial communication, parallel communication, SPI and ADCs. Write .pdf
serial communication, parallel communication, SPI and ADCs. Write .pdfserial communication, parallel communication, SPI and ADCs. Write .pdf
serial communication, parallel communication, SPI and ADCs. Write .pdfneerajsachdeva33
 
The first part of the assignment involves creating very basic GUI co.pdf
The first part of the assignment involves creating very basic GUI co.pdfThe first part of the assignment involves creating very basic GUI co.pdf
The first part of the assignment involves creating very basic GUI co.pdfneerajsachdeva33
 
Suppose that a heap stores 210 elements. What is its height (show w.pdf
Suppose that a heap stores 210 elements. What is its height (show w.pdfSuppose that a heap stores 210 elements. What is its height (show w.pdf
Suppose that a heap stores 210 elements. What is its height (show w.pdfneerajsachdeva33
 
Oxfam used its existing opt-in e-mail list only for this campaign; i.pdf
Oxfam used its existing opt-in e-mail list only for this campaign; i.pdfOxfam used its existing opt-in e-mail list only for this campaign; i.pdf
Oxfam used its existing opt-in e-mail list only for this campaign; i.pdfneerajsachdeva33
 
Please distinguish between the .h and .cpp file, create a fully work.pdf
Please distinguish between the .h and .cpp file, create a fully work.pdfPlease distinguish between the .h and .cpp file, create a fully work.pdf
Please distinguish between the .h and .cpp file, create a fully work.pdfneerajsachdeva33
 
JUST DO QUESTION 4 1. When you are preparing a budget where could yo.pdf
JUST DO QUESTION 4 1. When you are preparing a budget where could yo.pdfJUST DO QUESTION 4 1. When you are preparing a budget where could yo.pdf
JUST DO QUESTION 4 1. When you are preparing a budget where could yo.pdfneerajsachdeva33
 
In the paramyxoviruses, cleavage of the F0 protein into two subunits .pdf
In the paramyxoviruses, cleavage of the F0 protein into two subunits .pdfIn the paramyxoviruses, cleavage of the F0 protein into two subunits .pdf
In the paramyxoviruses, cleavage of the F0 protein into two subunits .pdfneerajsachdeva33
 
Information about dengue fever is provided on the following pages. A.pdf
Information about dengue fever is provided on the following pages. A.pdfInformation about dengue fever is provided on the following pages. A.pdf
Information about dengue fever is provided on the following pages. A.pdfneerajsachdeva33
 

More from neerajsachdeva33 (20)

Can you please explain those risk management from Kaiser Permanente.pdf
Can you please explain those risk management from Kaiser Permanente.pdfCan you please explain those risk management from Kaiser Permanente.pdf
Can you please explain those risk management from Kaiser Permanente.pdf
 
A survey of 2630 musicians showed that 372 of them are left-handed. .pdf
A survey of 2630 musicians showed that 372 of them are left-handed. .pdfA survey of 2630 musicians showed that 372 of them are left-handed. .pdf
A survey of 2630 musicians showed that 372 of them are left-handed. .pdf
 
What is other disorder of arteries beside atherosclerosis What.pdf
What is other disorder of arteries beside atherosclerosis What.pdfWhat is other disorder of arteries beside atherosclerosis What.pdf
What is other disorder of arteries beside atherosclerosis What.pdf
 
Why is a egg cell is much larger than a sperm cell Explain in 1-2 p.pdf
Why is a egg cell is much larger than a sperm cell Explain in 1-2 p.pdfWhy is a egg cell is much larger than a sperm cell Explain in 1-2 p.pdf
Why is a egg cell is much larger than a sperm cell Explain in 1-2 p.pdf
 
What type of relationship typically exists between the resident and t.pdf
What type of relationship typically exists between the resident and t.pdfWhat type of relationship typically exists between the resident and t.pdf
What type of relationship typically exists between the resident and t.pdf
 
What is the model for floral induction by day-lengthSolutionB.pdf
What is the model for floral induction by day-lengthSolutionB.pdfWhat is the model for floral induction by day-lengthSolutionB.pdf
What is the model for floral induction by day-lengthSolutionB.pdf
 
What is the difference between a semi-permeable and selectively perm.pdf
What is the difference between a semi-permeable and selectively perm.pdfWhat is the difference between a semi-permeable and selectively perm.pdf
What is the difference between a semi-permeable and selectively perm.pdf
 
what did Linnaeus contribute to taxonomySolutionThe classifica.pdf
what did Linnaeus contribute to taxonomySolutionThe classifica.pdfwhat did Linnaeus contribute to taxonomySolutionThe classifica.pdf
what did Linnaeus contribute to taxonomySolutionThe classifica.pdf
 
We are interested in whether the proportions of female suicide victim.pdf
We are interested in whether the proportions of female suicide victim.pdfWe are interested in whether the proportions of female suicide victim.pdf
We are interested in whether the proportions of female suicide victim.pdf
 
True or false Fruits attract animals that act as pollinators T.pdf
True or false Fruits attract animals that act as pollinators T.pdfTrue or false Fruits attract animals that act as pollinators T.pdf
True or false Fruits attract animals that act as pollinators T.pdf
 
the observed locations of integrated retroviral proviruses within ho.pdf
the observed locations of integrated retroviral proviruses within ho.pdfthe observed locations of integrated retroviral proviruses within ho.pdf
the observed locations of integrated retroviral proviruses within ho.pdf
 
The general name for something that binds to a protein is Select one.pdf
The general name for something that binds to a protein is  Select one.pdfThe general name for something that binds to a protein is  Select one.pdf
The general name for something that binds to a protein is Select one.pdf
 
serial communication, parallel communication, SPI and ADCs. Write .pdf
serial communication, parallel communication, SPI and ADCs. Write .pdfserial communication, parallel communication, SPI and ADCs. Write .pdf
serial communication, parallel communication, SPI and ADCs. Write .pdf
 
The first part of the assignment involves creating very basic GUI co.pdf
The first part of the assignment involves creating very basic GUI co.pdfThe first part of the assignment involves creating very basic GUI co.pdf
The first part of the assignment involves creating very basic GUI co.pdf
 
Suppose that a heap stores 210 elements. What is its height (show w.pdf
Suppose that a heap stores 210 elements. What is its height (show w.pdfSuppose that a heap stores 210 elements. What is its height (show w.pdf
Suppose that a heap stores 210 elements. What is its height (show w.pdf
 
Oxfam used its existing opt-in e-mail list only for this campaign; i.pdf
Oxfam used its existing opt-in e-mail list only for this campaign; i.pdfOxfam used its existing opt-in e-mail list only for this campaign; i.pdf
Oxfam used its existing opt-in e-mail list only for this campaign; i.pdf
 
Please distinguish between the .h and .cpp file, create a fully work.pdf
Please distinguish between the .h and .cpp file, create a fully work.pdfPlease distinguish between the .h and .cpp file, create a fully work.pdf
Please distinguish between the .h and .cpp file, create a fully work.pdf
 
JUST DO QUESTION 4 1. When you are preparing a budget where could yo.pdf
JUST DO QUESTION 4 1. When you are preparing a budget where could yo.pdfJUST DO QUESTION 4 1. When you are preparing a budget where could yo.pdf
JUST DO QUESTION 4 1. When you are preparing a budget where could yo.pdf
 
In the paramyxoviruses, cleavage of the F0 protein into two subunits .pdf
In the paramyxoviruses, cleavage of the F0 protein into two subunits .pdfIn the paramyxoviruses, cleavage of the F0 protein into two subunits .pdf
In the paramyxoviruses, cleavage of the F0 protein into two subunits .pdf
 
Information about dengue fever is provided on the following pages. A.pdf
Information about dengue fever is provided on the following pages. A.pdfInformation about dengue fever is provided on the following pages. A.pdf
Information about dengue fever is provided on the following pages. A.pdf
 

Recently uploaded

Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonhttgc7rh9c
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfNirmal Dwivedi
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Celine George
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 

Recently uploaded (20)

Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Our Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdfOur Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdf
 

Create a procedural C++ program called datatype_sizes.cc that will o.pdf

  • 1. Create a procedural C++ program called datatype_sizes.cc that will output the sizes in bytes of the datatypes long int, float, double and float *. Make your program simple and and its logic straightforward. For example, the program logic can consist solely of four printf() statements. . With the exception of warnings about parameters argc and argv of function main() not being used, your program must compile without errors or warnings when the -Wall and -Wextra options are given to the C++ compiler. Hint: use the C/C++ function sizeof(). The return type of sizeof() is size_t. To have printf(3) output a value of type size_t, use the “%zu” or “%zd” format specification. Note: overly and unnecessarily complex programs may be docked marks. Solution #include int main() { printf("Size of long int = %zu ",sizeof(long int)); printf("Size of float = %zu ",sizeof(float)); printf("Size of double = %zu ",sizeof(double)); printf("Size of float* = %zu ",sizeof(float *)); } /* sample output */