Question: 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
Get step-by-step solutions from verified subject matter experts
