Ask Question
8 February, 09:59

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

+2
Answers (1)
  1. 8 February, 13: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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers