Ask Question
12 September, 04:11

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. 12 September, 04:39
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers