Ask Question
29 July, 12:50

Struct personalInfo { string name; int age; double height; double weight; }; struct commonInfo { string name; int age; }; personalInfo person1, person2; commonInfo person3, person4; Which of the following statements is valid in C++?

a. person2 = person4;

b. person1 = person3;

c. person2 = person3;

d. person2 = person1;

+4
Answers (1)
  1. 29 July, 15:07
    0
    The answer is "Option d".

    Explanation:

    In the given C+ + language structure code two structure "personalInfo and commonInfo" is defined, inside the personalInfo structure four variable "name, age, height, and weight" is defined. Then second, structure "commonInfo" is defined, which contain two variable that is "name and age" this variable datatype is same as the above structure. In the next line, both structures two object is created, in which only option d that is "person2 = person1" is correct because these object holds the same value and other options are not correct because they don't hold object values.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Struct personalInfo { string name; int age; double height; double weight; }; struct commonInfo { string name; int age; }; personalInfo ...” 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