Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q2. Structure is another user defined data type available in C that allows combination of data items from different datatype and usually used to represent
Q2. Structure is another user defined data type available in C that allows combination of data items from different datatype and usually used to represent a record. [11 marks] a) Define a structure data type named BMI_Data that consists of five data members (or member variables), which are character array variable named Name which can store maximum 50 characters, integer variable named Age and three floating point datatype named Weight, Height and BMI. [6 marks] b) Write a C programming statement to declare two struct BMI_Data variable, named Personl and Person2. [2 marks] c) Assume Personl and Person2 are two struct of BMI Data variables. From following program segment. Write a C programming statement that extend the program segment: [3 marks) 19 Person1. Weight=80; 20 Person1.Height=1.733; 21 Person2. Weight=65; 22 Person2.Height=1.658; i. To calculate BMI of Personl and Person2 based on the given data members Weight and Height ii. Assign the BMI value of both Personl and Person2 to the data member BMI iii. Print or Display the final output as shown in Figure 3. > clang-7 -pthread -lm -o main main.c ?./main BMI for personi is 26.637461 BMI for person2 is 23.645271
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started