Ask Question
16 November, 02:20

Define a struct named PatientData that contains two integer data members named heightInches and weightPounds. Sample output for the given program with inputs 63 115: c language

+5
Answers (1)
  1. 16 November, 02:45
    0
    Following are program to this question:

    #include / /defining hader file

    struct PatientData / /defining structure PatientData

    {

    int heightInches, weightPounds; / /defining integer variable

    };

    int main () / /defining main method

    {

    struct PatientData pd = {63,115}; / /creating structure object and assign value

    printf ("%d %d", pd. heightInches, pd. weightPounds); / /print value

    return 0;

    }

    Output:

    63 115

    Explanation:

    The program to this question can be described as follows:

    In this program, a structure "PatientData" is declared, in which two integer variables, that is "heightInches and weightPounds". Then the main method is declared, inside the main method, structure object "pd" is created, that assigns a value, that is "63 and 115", and uses the print method, that prints its value.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Define a struct named PatientData that contains two integer data members named heightInches and weightPounds. Sample output for the given ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers