Ask Question
27 November, 19:13

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;

+5
Answers (1)
  1. 27 November, 19:28
    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?
Find 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 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